[TYPO3] Extension templates

JoH asenau info at cybercraft.de
Mon Oct 16 00:49:59 CEST 2006


> - does using an include file in my setup have pros/cons and how does
> it effect the time it takes to generate a page?
>   (put in using <INCLUDE_TYPOSCRIPT: source="FILE:
> fileadmin/include.txt">)

Never really tried that, but it could have advantages when you want to use
your favourite editor (i.e. with syntax highlighting for TS).
Major drawback: You can't use the history functions of the TYPO3 BE, so it's
almost impossible to switch back to older versions, when you did something
wrong. Of course you can save different versions, but this will take much
more time and is not really comfortable.
With the history functions you can even track who has been editing the
template and what he did.

> - does using conditionals ina template have pros/cons and what impact
> it has on page generation?
> (a conditional like [gloablVar = TSFE:id=3] )

Don't know about the cons but the pros are that you can adjust your
templates without having to struggle with stdWrap.if

Usually I use a default setup inside a temp.whatever = COA. Together with
conditions this gives me the highgest flexibility. Example:

page = PAGE

temp.mySetup = COA
temp.mySetup {
    wrap = <defaultwrap>|</defaultwrap>
    10 = WHATEVER
    10 {
        blah
    }
    20 = WHATEVER
    20 {
        blah
    }
    30 = WHATEVER
    30 {
        blah
    }
}

[condition1]
    page.includeCSS.css1 = pathto/stylesheet1.css
    temp.mySetup.wrap = <wrap1>|</wrap1>
    temp.mySetup.20 >
[condition2]
    page.includeCSS.css2 = pathto/stylesheet2.css
    temp.mySetup.wrap = <wrap2>|</wrap2>
    temp.mySetup.30 >
[global]

page {
    includeCSS.default = pathto/stylesheet.css
    10 < temp.mySetup
}

> - does having multiple typoscript templates have a pro/con and how
> does it effect pages generation?

Well - it makes sense to split up the whole setup into smaller chunks for
each part of this setup. You can have temp.topmenu, temp.leftmenu,
temp.content, temp.news, temp.whatever - each of them in it's own
TS-template.

Then you can include and use them on demand with "include basis template".
After including the template you can use the temp.whatever element defined
in this template wherever you like.

You just have to make sure, that the template containing the temp part you
want to use has been included before or with the template you are currently
working on.

The major advantages:
You don't have to rewrite stuff that is using similar code.
You will get much better overview over the different functionalities of your
template.
Many developers can work on different parts of the template without a "last
one who saves wins" situation.

But this is just my way of doing things with TS ... other people might tell
you a different story :-)

Joey

-- 
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your knob sometimes!)
Dieter Nuhr, German comedian
openBC: http://www.cybercraft.de
T3 cookbook: http://www.typo3experts.com





More information about the TYPO3-english mailing list