[TYPO3] Dynamically choose the right template using TEMPLATE COA IF - Is this the right solution??
Karol Martinka
kmartinka at accalio.com
Sun Dec 16 20:26:00 CET 2007
Hi!
It may be, I've found the solution, but I'm not sure, if it is correct and if there isn't any memory-leak... I just swapped the "idea" how to process the template...
temp.mainTemplateProc=TEMPLATE
temp.mainTemplateProc {
workOnSubpart=BODY_CONTENT
subparts.MENU_ITEMS < lib.menue
.
.
.
}
temp.mainTemplate = COA
temp.mainTemplate {
10 = COA
10 {
if.isTrue.numRows < styles.content.getRight
10 = TEMPLATE
10 < temp.mainTemplateProc
10 {
template = FILE
template.file = fileadmin/templates/textual-template.html
relPathPrefix = fileadmin/templates/
}
}
20 = COA
20 {
if.isFalse.numRows < styles.content.getRight
10 = TEMPLATE
10 < temp.mainTemplateProc
10 {
template = FILE
template.file = fileadmin/templates/textual-template_noRight.html
relPathPrefix = fileadmin/templates/
}
}
}
It works, but is it correct?? Any suggestions?
Thanks
Karol
"Karol Martinka" <kmartinka at accalio.com> wrote in message news:mailman.1.1197832692.22812.typo3-english at lists.netfielders.de...
Hello,
I have this code, which works, except that I'm unable to process the template on the end at all :)) (below the line temp.mainTemplate { - the code is skipped) - Btw. I think the problem might be the association - highlighted in RED. But how to repair it, please? I don't want to duplicate my code..
temp.mainTemplateProc = COA
temp.mainTemplateProc {
10 = COA
10 {
if.isTrue.numRows < styles.content.getRight
10 = TEMPLATE
10 {
template = FILE
template.file = fileadmin/templates/textual-template.html
relPathPrefix = fileadmin/templates/
}
}
20 = COA
20 {
if.isFalse.numRows < styles.content.getRight
10 = TEMPLATE
10 {
template = FILE
template.file = fileadmin/templates/textual-template_noRight.html
relPathPrefix = fileadmin/templates/
}
}
}
temp.mainTemplate=TEMPLATE
temp.mainTemplate < temp.mainTemplateProc
temp.mainTemplate {
workOnSubpart=BODY_CONTENT
subparts.MENU_ITEMS < lib.menu
.
.
.
}
Thanks in advance
Karol
More information about the TYPO3-english
mailing list