Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.
| Nächste Überarbeitung | Vorherige Überarbeitung | ||
| typo3:about:functions:current [2014/03/11 20:07] – angelegt admin | typo3:about:functions:current [2017/12/14 20:10] (aktuell) – [current] admin | ||
|---|---|---|---|
| Zeile 4: | Zeile 4: | ||
| **Beispiel: | **Beispiel: | ||
| - | Das Elternelement ist hier das cObject '' | + | Der Wert des cObject '' |
| + | <code typoscript> | ||
| + | page = PAGE | ||
| + | page { | ||
| + | 10 = TEXT | ||
| + | 10 { | ||
| + | value = eins,zwei | ||
| + | split { | ||
| + | token = , | ||
| + | cObjNum = 1 | ||
| + | 1.current = 1 | ||
| + | 1.wrap = < | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | # Ausgabe: < | ||
| + | </ | ||
| + | |||
| + | Wer sich in diesem Beispiel mit '' | ||
| + | |||
| + | <WRAP center round important 80%> | ||
| + | Das Elternelement in diesem Beispiel ist **nicht** das cObject '' | ||
| + | </ | ||
| <code typoscript> | <code typoscript> | ||
| 10 = TEXT | 10 = TEXT | ||
| - | 10 { | + | 10.current = 1 |
| - | value = eins,zwei | + | 10.wrap = < |
| + | 20 = TEXT | ||
| + | 20 { | ||
| + | value = Hund,Katze,Maus | ||
| split { | split { | ||
| token = , | token = , | ||
| - | cObjNum = 1 | + | cObjNum = 1|*|2|*|3 |
| 1.current = 1 | 1.current = 1 | ||
| - | 1.wrap = <p>|</p> | + | 1.wrap = <h1>|</h1> |
| } | } | ||
| } | } | ||
| - | # Ausgabe: <p>eins</ | + | 30 = TEXT |
| + | 30.current = 1 | ||
| + | 30.wrap = < | ||
| + | 40 = TEXT | ||
| + | 40.current = 1 | ||
| + | 40.wrap = < | ||
| + | # Ausgabe: <p></p> < | ||
| </ | </ | ||
| - | Wer sich in diesem Beispiel mit '' | + | **Zwei Dinge fallen auf:** |
| + | - Der current-Wert ist nicht nur innerhalb von '' | ||
| + | - Außerhalb von '' | ||
| + | |||
| + | ---- | ||
| ===== setContentToCurrent ===== | ===== setContentToCurrent ===== | ||
| Zeile 50: | Zeile 85: | ||
| Ausgabe: < | Ausgabe: < | ||
| </ | </ | ||
| + | |||
| + | ---- | ||
| ===== setCurrent ===== | ===== setCurrent ===== | ||
| Zeile 78: | Zeile 115: | ||
| </ | </ | ||
| - | ===== setCurrent oder setContentToCurrent? | + | ---- |
| + | ===== current als Variable nutzen ===== | ||
| + | |||
| + | Wie oben bereits erklärt, kann man mit '' | ||
| + | |||
| + | In den folgenden Beispielen wird jeweils ein Wrap mit dynamischem Inhalt (aktuelle Seiten-ID) als current-Wert gespeichert und anschließend zwei verschiedenen cObjects als '' | ||
| + | |||
| + | Während der current-Wert im ersten Beispiel innerhalb von '' | ||
| + | |||
| + | <code typoscript> | ||
| + | 10 = TEXT | ||
| + | 10 { | ||
| + | setCurrent = <div class=" | ||
| + | setCurrent.insertData = 1 | ||
| + | cObject = COA | ||
| + | cObject { | ||
| + | 10 = TEXT | ||
| + | 10.field = title | ||
| + | 10.required = 1 | ||
| + | 10.outerWrap.current = 1 | ||
| + | 20 = TEXT | ||
| + | 20.field = description | ||
| + | 20.required = 1 | ||
| + | 20.outerWrap.current = 1 | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | <code typoscript> | ||
| + | 20 = COA | ||
| + | 20 { | ||
| + | 10 = TEXT | ||
| + | 10.field = uid | ||
| + | # Leerzeichen bei '< | ||
| + | 10.wrap = < div class=" | ||
| + | 20 = TEXT | ||
| + | 20.value = |</ | ||
| + | | ||
| + | stdWrap.setContentToCurrent = 1 | ||
| + | stdWrap.cObject = COA | ||
| + | stdWrap.cObject { | ||
| + | 10 = TEXT | ||
| + | 10.field = title | ||
| + | 10.required = 1 | ||
| + | 10.outerWrap.current = 1 | ||
| + | | ||
| + | 20 = TEXT | ||
| + | 20.field = description | ||
| + | 20.required = 1 | ||
| + | 20.outerWrap.current = 1 | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | <code html> | ||
| + | <div class=" | ||
| + | <div class=" | ||
| + | </ | ||