---
title: "Template abhängig von Spalteninhalt"
url: "https://www.typo3.net/d/41551-template-abhaengig-von-spalteninhalt"
source: "typo3.net"
tags: ["TYPO3","TypoScript","Frage","Templates & Layouts"]
created: "2006-04-18"
last_reply: "2006-04-18"
replies: 1
solved: false
page: 1
pages: 1
lang: "de"
---

# Template abhängig von Spalteninhalt

TYPO3 › TypoScript · 1 Antwort · gestartet 2006-04-18

## Eröffnungsbeitrag

**wexpress** · 2006-04-18 · [Beitrag #1](https://www.typo3.net/d/41551-template-abhaengig-von-spalteninhalt/1)

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

```typoscript
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.

```typoscript
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

## Antworten

### [#2](https://www.typo3.net/d/41551-template-abhaengig-von-spalteninhalt/2) · wexpress · 2006-04-18

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

zuerst

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

und dann

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

---

Quelle: „Template abhängig von Spalteninhalt“, typo3.net, https://www.typo3.net/d/41551-template-abhaengig-von-spalteninhalt
Beiträge von Mitgliedern des Forums. Bitte mit Link auf die Diskussion zitieren.
