[TYPO3] Nesting templates

Lars Kappert lars at efocus.nl
Wed Sep 20 12:08:07 CEST 2006


Hello,

I'd like to know how I could/should use the nesting of templates. I have
something working right now, but the second (inner) template (which is
an "+ext" under the main template) actually overwrites the complete
<body> of the first (outer) template. I know why this is, but I don't
know how to do it right. Excuse me for the amount of TS, but I hope my
problem is clear this way.

---
The setup of the first template:
---

plugin.tx_automaketemplate_pi1 {
    content = FILE
    content.file = fileadmin/templates/main/main.html
    elements {
        BODY.all = 1
        BODY.all.subpartMarker = DOCUMENT_BODY
        HEAD.all = 1
        HEAD.all.subpartMarker = DOCUMENT_HEADER
        HEAD.rmTagSections = title
        UL.all = 1
    }
}

temp.mainTemplate = TEMPLATE
temp.mainTemplate {
    template =< plugin.tx_automaketemplate_pi1
    workOnSubpart = DOCUMENT_BODY  
    subparts.navigation = HMENU
    [...]
}

temp.headTemplate = TEMPLATE
temp.headTemplate {
    template =< plugin.tx_automaketemplate_pi1
    workOnSubpart = DOCUMENT_HEADER
}

# finish!
page.10 < temp.mainTemplate
page.headerData.10  < temp.headTemplate

---
The setup of the second template:
---

plugin.tx_automaketemplate_pi1 {
  content = FILE
  content.file = fileadmin/templates/main/home.html
  elements {
    BODY.all = 1
    BODY.all.subpartMarker = DOCUMENT_BODY
    DIV.all = 1
  }
}

temp.homeTemplate = TEMPLATE
temp.homeTemplate {
    template =< plugin.tx_automaketemplate_pi1
    workOnSubpart = DOCUMENT_BODY

    subparts.content-sub = CONTENT 
    [...]
}

page.10 < temp.homeTemplate

---

But I'd like to get the output of the first template, copy it to the
setup of this inner template and then work further with it (attach
markers, etc.). Should I do it this way or is there a better
alternative? For I couldn't really find something like this in de
manuals/docs. Any help would be appreciated!



More information about the TYPO3-english mailing list