[TYPO3-english] [TV] Dividing templates

Dmitry Dulepov dmitry at typo3.org
Tue Mar 3 15:57:25 CET 2009


Hi!

Jon Burton wrote:
> I'm also very interested in this because we use the same header and
> footer in 47 templates across 6 domains!

It is easy! :) Here is how:
- make FCEs for the header and the footer
- in all 47 templates map headers and footers as TS object path (lib.header and lib.footer)
- insert FCEs on some page, which is not in menu (it can be a sysfolder too but should not be hidden)
- use TS to select header and footer elements by uid and display them in lib.header and lib.footer. For example:

lib.header = CONTENT
lib.header {
	select.uidInList = 123
	select.pidInList = 456
	renderObj < styles.content.get
}

TS is not tested but they idea should be clear.

This opens you a lot of possibilities to change headers and footers (for example, for new year or easter). Prepare a new template object for the header and change it in the header. Clear cache and all your sites now have a new header! :)

-- 
Dmitry Dulepov
TYPO3 core team
http://dmitry-dulepov.com/
"Sometimes they go bad. No one knows why" (Cameron, TSCC, "Dungeons&Dragons")


More information about the TYPO3-english mailing list