[TYPO3] Sub-Templates?

Amir M. amir219 at sbcglobal.net
Fri Jul 21 16:02:47 CEST 2006


Christopher wrote:
> Hi Amir,
> 
> On 7/21/06, Amir M. <amir219 at sbcglobal.net> wrote:
> 
>> 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.
> 
> 
> You have about 10000 different possibilities. The simplest is probably
> to define the layout used by the _majority_ of the pages and then
> override that layout for the minority page(s) using a TS condition
> [1]. For example, if your header is defined as a TS object something
> like this:
> 
> # Header object for all inside pages:
> page.10 = HTML
> page.10 {
>  value (
> <!-- [header content goes here] -->
> )
>  value.wrap = <div id="header">|</div>
> }
> 
> ...you can override it with a TS condition:
> 
> [treeLevel = 0]
> page.10.value (
> <!-- [some different content goes here] -->
> )
> [global]
> 
> If you'd rather keep the content the same, and just change how it
> _looks_ on one page compared to another, you could use a similar
> strategy to change the body element on the page:
> 
> # Default body tag:
> page.bodyTagCObject = HTML
> page.bodyTagCObject {
>  value = <body>
> }
> 
> # Body tag for root page of site only:
> [treeLevel = 0]
> page.bodyTagCObject.value = <body id="root">
> [global]
> 
> In this case, you'd make the changes in appearance in the stylesheet:
> 
> /* Default appearance */
> #header {
> /* styles */
> }
> 
> /* Root page appearance */
> body#root #header {
> /* styles */
> }
> 
> Thirdly, you could also use a completely separate TS template and
> select it in the "Template on next level:" field in your main TS
> template.
> 
> -Christopher
> 
> [1] 
> http://typo3.org/documentation/document-library/references/doc_core_tsref/current/view/7/5/ 
> 

Well as of right now, the site banner is not even defined at all, 
anywhere.  I am using TV, however the banner is just part of the html 
template, and I never even created an object for it or anything.

However, now, that is the ONLY thing I would like to be different among 
the sub-sections.  Everything else is fine, and its the most convenient 
to have the master template for all the pages, but I'd just like to have 
a different banner and that is all.




More information about the TYPO3-english mailing list