[TYPO3-german] If Rechte Spalte hat keinen Inhalt

Christoph typo3 at itfoo.de
Wed Mar 22 14:41:55 CET 2017


Hallo Matthias,

unten ein Code, der bei leerer rechter Spalte Inhalt aus einer andere
Seite holt.
Ggf. kannst Du Dir das für Deine Idee anpassen.

VG
Christoph


RECHTS >
RECHTS = COA
RECHTS {
###Hole Inhalt aus rechter Spalte
10 < styles.content.getRight
### wenn leer, dann inhalt aus anderer Seite holen
10.stdWrap.ifEmpty.cObject = CONTENT
10.stdWrap.ifEmpty.cObject {
table = tt_content
select {
### Seite, aus der der Inhalt kommt (id 65)
pidInList = 18
languageField = sys_language_uid 
orderBy = sorting
where = colPos=2
}
}
10.stdWrap.ifEmpty.stdWrap.wrap = <ul><li>|</li></ul> # wraped die "if
empty" inhalte
10.renderObj.stdWrap.wrap = <ul><li>|</li></ul>  #Um die anderen Inhalte
jeweils zu wrapen

}


Am 22.03.2017 um 14:19 schrieb Matthias Gmeiner:
> Hallo.
>
> Ich würde gerne checken ob die rechte Spalte leer ist und wenn ja dann
> soll ein Wert gesetzt werden.
> Da ich dann gerne im Template col-2-3 auf col-1-1 (class) stellen möchte.
>
> In PHP würd ich das so machen :)
>
> $rechtespalte = CONTENTRIGHT
>
> if (empty($rechtespalte)) {
>    echo 'col-2-3 ';
> }
> else {
>    echo 'col-1-1 ';
> }
>
> Das habe ich in meinem TypoScript drinnen:
>
> page.10.subparts {
>
>  ////////////////////////////////////////////////////////////////////////////////////////////
>
>  //
>  // Subpart CONTENTRIGHT
>  //
>  ////////////////////////////////////////////////////////////////////////////////////////////
>
>
>  CONTENTRIGHT = CONTENT
>  CONTENTRIGHT < styles.content.getRight
>
>
>  ////////////////////////////////////////////////////////////////////////////////////////////
>
>  //
>  // Subpart CONTENTMIDDLE
>  //
>  ////////////////////////////////////////////////////////////////////////////////////////////
>
>
>  CONTENTMIDDLE = CONTENT
>  CONTENTMIDDLE < styles.content.get
>
> }
>
> Ich möchte nicht 2 Templates anlegen, sondern das ganze über
> TypoScript steuern.
>
> Liebe Grüße
> Matthias
> _______________________________________________
> TYPO3-german mailing list
> TYPO3-german at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-german




More information about the TYPO3-german mailing list