Nimmt das 1. Template wenn in der rechten Spalte ein Inhalt vorhanden ist, ansonsten das 2.
Template abhängig von Spalteninhalt
TypoScript
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 } } }

Impressum
Mollio

1
Seite 1 von 1
Hallo!
Ich benutze den Autoparser um die meine Templates einzulesen:
# Configuring the Auto-Parser for main template:
plugin.tx_automaketemplate_pi1 {
# Read the template file:
c FILE
content.file = fileadmin/templates/MyTemplate.tmpl.html
# Here we define which elements in the HTML that
# should be wrapped in subpart-comments:
elements {
BODY.all = 1
BODY.all.subpartMarker = DOCUMENT_BODY
HEAD.all = 1
HEAD.all.subpartMarker = DOCUMENT_HEADER
HEAD.rmTagSecti title
TD.all = 1
DIV.all = 1
}
# Prefix all relative paths with this value:
relPathPrefix = fileadmin/templates/
}
und weise dies dann hier zu:
# Main TEMPLATE cObject for the BODY
temp.mainTemplate = TEMPLATE
temp.mainTemplate {
# Feeding the content from the Auto-parser to the TEMPLATE cObject:
template =< plugin.tx_automaketemplate_pi1
# Select only the content between the <body>-tags
workOnSubpart = DOCUMENT_BODY
# Substitute the menus subpart with dynamic menu:
subparts.MENU1 < Menu1
# Substitute the content subpart with some example content:
subparts.CONTENT < styles.content.get
subparts.CONTENTRIGHT < styles.content.getRight
}
... und letztendlich hier zur Seite:
page.10 < temp.mainTemplate
Ich bekomme es einfach nicht hin, obiges Prinzip auf meinen Anwendungsfall mit dem Auto-Parser anzupassen.
Kann mir da jemand helfen?
Selbstverständlich kannst Du das für alle möglichen Ausgaben nutzen, im Prinzip gehts ja um den Einsatz von if
Wäre es denkbar, im Falle eines Inhalts Rechts den Inhalt zu schreiben und sonst dafür als Ersatz was anderes zu nehmen? Ich denke da an Inhalt eine Seite, z.B. sowas wie:
temp.rightside = COA
temp.rightside {
10 = COA
10 {
if.isTrue.numRows < styles.content.getRight
10 = CONTENT
10 < styles.content.getRight
}
20 = COA
20 {
if.isFalse.numRows < styles.content.getRight
20 = RECORDS
20.tables = tt_content
20.source = 199
20.dontCheckPid = 1
}
}