Let's assume you don't just want to inject some HTML if there is content in a column, but you want to use a completely different layout. This isn't hard to accomplish, see the example:
tmp.templateFile = COA
tmp.templateFile {
10 = COA
10 {
if.isFalse.numRows < styles.content.getRight
10 = FILE
10 {
file = fileadmin/template/1col.html
}
}
20 = COA
20 {
if.isTrue.numRows < styles.content.getRight
10 = FILE
10 {
file = fileadmin/template/2col.html
}
}
}
The ifs check if there is or isn't content in the right column and the COA returns the correct cObject, FILE in this case.And then in your main typoscript something like:
page.10.template < tmp.templateFile
instead of the more usual
page {
10 = TEMPLATE
10 {
template = FILE
template {
file = fileadmin/template/1col.html
}
}
}
That's all.
I am Nicolas Kuttler, a web developer, system administrator and IT consultant from France, currently living in Germany.
5 comments
Start a new thread