

Uses the 1. template if in the right column is some content else the 2. one.
temp.maintemplate= COA temp.maintemplate { 10 = COA 10 { if.isTrue.numRows < styles.content.getRight 10 = TEMPLATE 10 { template = FILE template.file = fileadmin/templates/template-2column.html } } 20 = COA 20 { if.isFalse.numRows < styles.content.getRight 10 = TEMPLATE 10 { template = FILE template.file = fileadmin/templates/template.html } } }




styles.content.get = CONTENT
styles.content.get {
table = tt_content
select.orderBy = sorting
select.where = colPos=0
select.languageField = sys_language_uid
}
styles.content.getLeft < styles.content.get
styles.content.getLeft.select.where = colPos=1
styles.content.getRight < styles.content.get
styles.content.getRight.select.where = colPos=2
styles.content.getBorder < styles.content.get
styles.content.getBorder.select.where = colPos=3
I had to add this manually to the Typoscript and then it worked.
Using CSC will have previously defined what each of the styles.content.get are.
temp.resource = COA
temp.resource {
10 = COA
10 {
if.isTrue.numRows < styles.content.getRight
10 = TEMPLATE
10 {
template = FILE
template.file = fileadmin/tmpl/tmpl01.html
}
}
20 = COA
20 {
if.isFalse.numRows < styles.content.getRight
10 = TEMPLATE
10 {
template = FILE
template.file = fileadmin/tmpl/tmpl02.html
}
}
}
### Configuration of the auto template parser: ###
plugin.tx_automaketemplate_pi1 {
content < temp.resource
ifTrue.numRows < styles.content.getLeft
ifTrue.numRows < styles.content.getRight
and it ignores the first row. That's probably the expected behaviour but strange for a newbie like me.
The workaround was to use:
value = 0
ifGreaterThan.numRows < styles.content.getLeft
ifTrue.numRows < styles.content.getRight
(or .equals instead of repeated isFalse)
I need to load CSS file according to different conditions
(if left and normal columns are not empty)
(if right and normal columns are not empty)
(if left and right and normal columns are not empty)
is it possible to make such complex conditions using typoscript?
Add comment