Zum Inhalt springen

Template abhängig von Spalteninhalt

Erstellt am 18. April 2006 · 1 Antwort · letzte Antwort am 18. April 2006

Tags: Templates & Layouts, Frage

wexpress ·

Ich habe folgendes Problem, ich möchte verschiedene Tempaltes aufrufen, abhängig davon ob in der Rechten Spalte Inhalt enthalten ist oder nicht.

Ich rufe mein Template im Moment so auf

page.10 = TEMPLATE
page.10 {
template = FILE
template.file = fileadmin/templates/template1.htm
workOnSubpart = DOKUMENT

marks {

content_normal  < styles.content.get 
content_normal = CONTENT
content_normal.table = tt_content

content_right < styles.content.getRight 
content_right = CONTENT
content_right.table = tt_content

…..
….
…

}

Jetzt habe ich versucht noch ein zweites Template einzubinden welches nur dann aufgerufen wird wenn rechts kein Inhalt ist. So funktioniert es jedenfalls nicht.

page.10 = TEMPLATE
page.10 {
template = FILE

if.isTrue.numRows < styles.content.getRight
template.file = fileadmin/templates/template1.htm

if.isFalse.numRows < styles.content.getRight
template.file = fileadmin/templates/template2.htm
 
workOnSubpart = DOKUMENT

marks {

....

}

Kann mir jemand einen Tipp geben wie ich es lösen könnte?

Vielen Dank

wexpress ·

Habe hier eine lösung gefunden
>> http://www.typo3wizard.com/de/snippets/general-config/template-abhaengig-von-spalteninhalt.html

zuerst

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
    }
  }
}

und dann

page.10 = TEMPLATE
page.10 {
template < temp.maintemplate
workOnSubpart = DOKUMENT