Zum Inhalt springen

Designvorlage abhänging vom Inhalt?

Erstellt am 3. Januar 2007 · 2 Antworten · letzte Antwort am 3. Januar 2007

Tags: Frage

Flint ·

Hallo,

kann man es mit Typo3 hinkriegen, dass eine Designvorlage abhängig von einem Inhaltselement gewählt wird?
Also, das html-Template "besonderercontent.html" soll nur gewählt werden wenn es min. 1 Inhaltselement in der Spalte Border gibt, ansonsten soll das html-Template "normalercontent.html" gewählt werden.

Also in etwa so:

page.10 = TEMPLATE
page.10{
template = FILE
template.file = fileadmin/normalercontent.html 
workOnSubpart = OUTPUT
marks.CONTENT < styles.content.get
usw.
}

Wenn es jetzt aber Inthalt(e) in der Spalte Border gibt sollte es dann so aussehen:

page.10 = TEMPLATE
page.10{
template = FILE
template.file = fileadmin/besonderercontent.html 
workOnSubpart = OUTPUT
marks.CONTENT < styles.content.get
usw.
}

ich probiere die ganze Zeit mit ifEmpty herum schaffe es aber nicht, irgendeinen Bezug zum Template hinzukriegen bzw. weiß ich nicht wie ich mit Bedingungen Inhalte überprüfen kann.

einpraegsam.​net ·
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
    }
  }
}

Wenn Inhalt Rechts, dann nimm template-2column.html, ansonsten template.html

Flint ·

Danke erstmal für die Antwort und ich glaube ich komme jetzt auch allmählich weiter. Ich hänge nämlich jetzt daran, dass ich die Marker nicht mehr angesprochen bekommen.
Mein TS sieht jetzt so aus:

temp.maintemplate= COA
temp.maintemplate {
  10 = COA
  10 {
    if.isTrue.numRows < styles.content.getRight
    10 = TEMPLATE
    10.template = FILE
    10.template.file = fileadmin/content.html
   }
  20 = COA
  20 {
    if.isFalse.numRows < styles.content.getRight
    10 = TEMPLATE
    10 {
       
      template = FILE
      template.file = fileadmin/content2.html
    }
  }
}


page.10 < temp.maintemplate 
#bis hier hat es geklappt

#und funktioniert jetzt nicht mehr:
page.10{
workOnSubpart = OUTPUT
marks.CONTENT < styles.content.get
}

So wird zwar des richtige Template abhängig vom Inhalt (Hurra!) eingebunden, aber ich mache da anscheinend noch einen Fehler mit den Markern?