[TYPO3] Different HTML templates depending on optional right column
Rickard Andersson
rickard.andersson+typo3 at gmail.com
Wed Nov 7 13:20:05 CET 2007
Thanks a LOT for the help, but it just won't work. Here's what I have now:
temp.mainTemplate = COA
temp.mainTemplate {
10 = COA
10 {
if.isTrue.numRows < styles.content.getRight
10 = TEXT
10.value = fileadmin/template/2col.html
}
20 = COA
20 {
if.isFalse.numRows < styles.content.getRight
10 = TEXT
10.value = fileadmin/template/1col.html
}
}
I believe you squeezed in an extra } or two in your last post, but
I've verified that the above works by doing something like:
marks.SOME_MARK < temp.mainTemplate
This replaces the mark with the correct HTML template file to load.
However, whenever I try to actually use it, I get a blank page. In
other words:
temp.mainContent = TEMPLATE
temp.mainContent {
template.file < temp.mainTemplate
marks.HEADER_1 = TEXT
marks.HEADER_1.field = title
marks.MAIN_CONTENTS < styles.content.get
marks.RIGHT_CONTENTS < styles.content.getRight
}
Yields a blank page. I've tried adding
template.file = FILE
before assigning the value of temp.mainTemplate, but it won't work.
Any idea what might be wrong?
Cheers,
Rickard
On Nov 7, 2007 12:45 PM, Bernd Wilke <xoonsji02 at sneakemail.com> wrote:
> Rickard Andersson schrieb:
>
> > I'm afraid I don't exactly understand what you mean. I tried this:
> >
> > temp.maintemplate = COA
> ^
> > temp.maintemplate {
> ^
> > 10 = COA
> > 10 {
> > if.isTrue.numRows < styles.content.getRight
> > 10 = TEMPLATE
> > 10 {
> > template = FILE
> > template.file = fileadmin/template/2col.html
> > }
> > }
> > 20 = COA
> > 20 {
> > if.isFalse.numRows < styles.content.getRight
> > 10 = TEMPLATE
> > 10 {
> > template = FILE
> > template.file = fileadmin/template/1col.html
> > }
> > }
> > }
> >
> > temp.mainContent = TEMPLATE
> > temp.mainContent {
> > template.file < temp.mainTemplate
> ^
> >
> > marks.HEADER_1 = TEXT
> > marks.HEADER_1.field = title
> > marks.MAIN_CONTENTS < styles.content.get
> > marks.RIGHT_CONTENTS < styles.content.getRight
> > }
> >
> > And then at the end of the template:
> >
> > page = PAGE
> > page.10 < temp.mainContent
> >
> > But all I get is a blank page.
> >
>
> oh,oh. :-(
> just a bit to hasty.
>
> I had to look closer.
> the part temp.mainTemplate is no text so my usage was false.
>
> try this one for temp.mainTemplate
>
> temp.mainTemplate = COA
> temp.mainTemplate {
> 10 = COA
> 10 {
> if.isTrue.numRows < styles.content.getRight
> 10 = TEXT
> 10.value = fileadmin/template/2col.html
> }
> }
> 20 = COA
> 20 {
> if.isFalse.numRows < styles.content.getRight
> 10 = TEXT
> 10.value = fileadmin/template/1col.html
> }
> }
> }
>
> and keep watch on upcase!
>
> temp.maintemplate
> is different from
> temp.mainTemplate
>
>
> Bernd
> --
> http://www.pi-phi.de/t3v4/cheatsheet.html
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english
>
More information about the TYPO3-english
mailing list