[TYPO3] Sub-Templates?

Bernd Wilke xoonsji02 at sneakemail.com
Fri Jul 21 01:51:59 CEST 2006


On Fri, 21 Jul 2006 09:22:14 -0400, Amir M. wrote
with subject "[TYPO3] Sub-Templates?":

> Hi,
> 
> I am not sure if this question has been addressed before, since I cannot 
> search the archives, but I am interested in creating sub-templates for 
> sections of my site.
> 
> For example, here is my main page:  www.stratcommandcenter.com/redesign4
> As you can see the banner says "Strategic Command Center"
> 
> However, for the sub-sites of the main site I'd like to create a 
> different banner, so there is a recognizable difference between the 
> sub-sites.  Here are the links to the subsites:
> 
> http://www.stratcommandcenter.com/redesign4/civilization-iv/
> http://www.stratcommandcenter.com/redesign4/total-war-series/
> 
> What would be the best way to use a different banner for each subsite?
> 
> Note, all the pages and all the sites use the same template, and I like 
> it that way, since I do want a unified design, however all I want is to 
> make a different banner for each section/sub-site.

just two further possibilies:
both request to have a marker/subpart in your template.

1. as I have done it three years ago:
define in your main-template a replacement for this marker like this:

page.10 = TEMPLATE
page.10 {
    template = FILE
    template.file= fileadmin/template/default.html
    workOnSubpart = DOCUMENT_BODY
    marks.LOGO = IMAGE
    marks.LOGO.file = fileadmin/image/logo/logo.png
}

and for every subpart of your page which gets another logo/image, you
define an extension-template with just one line:
page.10.marks.LOGO.file = fileadmin/image/logo/logo2.png

2. as I would do it nowadays ;-)

store your logos/images for each site-subpart in the media-field of the
starting page. Then use this field to replace the marker:

page.10 = TEMPLATE
page.10 {
    template = FILE
    template.file= fileadmin/template/default.html
    workOnSubpart = DOCUMENT_BODY
    marks.LOGO = IMAGE
    marks.LOGO.file {
	import = uploads/media/
	import {
	        data = levelmedia: -1, "slide"
		# decide which element of the media-field:
        	listNum = 0
	}
    }
}

Bernd

-- 
----------------
Bernd Wilke     
Annweilerstr.20 
40229 Düsseldorf
0211/229 2800



More information about the TYPO3-english mailing list