| Beide Seiten, vorherige ÜberarbeitungVorherige ÜberarbeitungNächste Überarbeitung | Vorherige Überarbeitung |
| typo3:about:functions:optionsplit [2014/01/16 20:26] – [optionSplit mit stdWrap.split] admin | typo3:about:functions:optionsplit [2017/12/05 21:37] (aktuell) – [Beispiele] admin |
|---|
| |
| ''|*|''zerlegt die Werte in maximal drei Teile.\\ | ''|*|''zerlegt die Werte in maximal drei Teile.\\ |
| ''||'' kann diese Teile in weitere Unterteile zerlegen. | ''||'' kann diese Teile in weitere Unterteile (Subparts) zerlegen. |
| | |
| | Zur Reihenfolge der Verarbeitung: |
| | * Die Reihenfolge bei den Hauptteilen ist **Ende, Anfang, Mitte**. Zuerst entfallen die mittleren Angaben, dann die vorderen. Im Zweifel werden also nur die Angaben aus dem letzten Teil des optionSplits genutzt. |
| | * Innerhalb der Subparts ''||'' hat am Anfang und in der Mitte der erste Eintrag Vorrang, am Ende wird zuerst der letzte Eintrag verwendet. |
| | * Bei mehr Werten als Angaben im optionSplit wird der mittlere Teil wiederholt. Gibt es Subparts im mittleren Teil, werden diese (von vorne ausgehend) abwechselnd wiederholt. |
| | |
| | Wenn innerhalb des optionSplits das Pipe-Symbol als Wrap-Markierung weggelassen wird, fügt TYPO3 das optionSplit-Element hinten an den Wert an. |
| | |
| | |
| | ==== Beispiele ==== |
| | |
| | Über ein ''wrap'' wird den Beispielwerten ein ''span''-Element mit Farbangabe sowie ein Komma zugewiesen: <code typoscript> |
| | wrap = <span style="color: XYZ">|,</span> |
| | </code> |
| | |
| | === Drei Teile: je einmal Anfang und Ende, der mittlere Teil wird wiederholt === |
| |
| <code typoscript> | <code typoscript> |
| | rot |*| orange |*| blau |
| | </code> |
| | <html><span style="color:red;">eins,</span><span style="color:orange;">zwei,</span><span style="color:orange;">drei,</span><span style="color:orange;">vier,</span><span style="color:orange;">fünf,</span><span style="color:orange;">sechs,</span><span style="color:blue;">sieben</span></html> |
| |
| | === Drei Teile, alle mit Untergruppen === |
| | |
| | ---- |
| | |
| | <code typoscript> |
| | rot||orange |*| blau||grün |*| purple||magenta |
| </code> | </code> |
| | <html><span style="color:magenta;">eins</span></html> |
| | |
| | <html><span style="color:purple;">eins,</span><span style="color:magenta;">zwei</span></html> |
| | |
| | <html><span style="color:red;">eins,</span><span style="color:purple;">zwei,</span><span style="color:magenta;">drei</span></html> |
| | |
| | <html><span style="color:red;">eins,</span><span style="color:orange;">zwei,</span><span style="color:blue;">drei,</span><span style="color:green;">vier,</span><span style="color:blue;">fünf,</span><span style="color:purple;">sechs,</span><span style="color:magenta;">sieben</span></html> |
| | |
| | ---- |
| | |
| | === Kein Mittelteil, nur Anfang und Ende === |
| | |
| | Kein Leerzeichen zwischen den Trennern. Der letzte Subpart des Anfangs wird wiederholt. |
| | |
| | <code typoscript> |
| | rot||orange |*||*| blau||grün |
| | </code> |
| | |
| | <html><span style="color:red;">eins,</span><span style="color:blue;">zwei,</span><span style="color:green;">drei</span></html> |
| | |
| | <html><span style="color:red;">eins,</span><span style="color:orange;">zwei,</span><span style="color:orange;">drei,</span><span style="color:orange;">vier,</span><span style="color:orange;">fünf,</span><span style="color:blue;">sechs,</span><span style="color:green;">sieben</span></html> |
| | |
| | ---- |
| | |
| | === Leerer Mittelteil === |
| | |
| | Bei leerem Hauptteil wird für die entsprechenden Werte kein ''wrap'' übergeben. Im Beispiel bleiben die mittleren Werte schwarz und das Komma fehlt. |
| | |
| | <code typoscript> |
| | rot||orange |*| |*| blau||grün |
| | </code> |
| | |
| | <html><span style="color:red;">eins,</span><span style="color:orange;">zwei,</span>dreivierfünf<span style="color:blue;">sechs,</span><span style="color:green;">sieben</span></html> |
| | |
| | ---- |
| | |
| | === Nur ein Hauptteil mit Subparts === |
| | |
| | Hier ist es wichtig, dass zwischen ''|*||*|'' kein Leerzeichen steht – sonst gilt dieser Teil der Anweisung als gesetzt (aber leer) und die Farben werden nicht auf alle Werte angewendet (siehe "Leerer Mittelteil"). |
| | |
| | <code typoscript> |
| | rot||orange||blau |*||*| |
| | </code> |
| | |
| | <html><span style="color:red;">eins,</span><span style="color:orange;">zwei</span></html> |
| | |
| | <html><span style="color:red;">eins,</span><span style="color:orange;">zwei,</span><span style="color:blue;">drei,</span><span style="color:blue;">vier,</span><span style="color:blue;">fünf</span></html> |
| | |
| | <code typoscript> |
| | |*| rot||orange||blau |*| |
| | </code> |
| | |
| | <html><span style="color:red;">eins,</span><span style="color:orange;">zwei</span></html> |
| | |
| | <html><span style="color:red;">eins,</span><span style="color:orange;">zwei,</span><span style="color:blue;">drei,</span><span style="color:red;">vier,</span><span style="color:orange;">fünf</span></html> |
| | |
| | <code typoscript> |
| | |*||*| rot||orange||blau |
| | </code> |
| | |
| | <html><span style="color:blue;">eins</span></html> |
| | |
| | <html><span style="color:orange;">eins,</span><span style="color:blue;">zwei</span></html> |
| | |
| | <html><span style="color:red;">eins,</span><span style="color:red;">zwei,</span><span style="color:red;">drei,</span><span style="color:orange;">vier,</span><span style="color:blue;">fünf</span></html> |
| | |
| | ---- |
| | |
| | === Nur Subparts, keine Trenner für Hauptparts === |
| | |
| | Zuweisung von links nach rechts. Der letzte Part wird wiederholt. |
| | |
| | <code typoscript> |
| | rot||orange||blau |
| | </code> |
| | |
| | <html><span style="color:red;">eins,</span><span style="color:orange;">zwei</span></html> |
| | |
| | <html><span style="color:red;">eins,</span><span style="color:orange;">zwei,</span><span style="color:blue;">drei,</span><span style="color:blue;">vier,</span><span style="color:blue;">fünf</span></html> |
| | |
| | ---- |
| | |
| | === Nur zwei Hauptteile === |
| | |
| | Bei zwei Hauptteilen gilt der Endpart als fehlend. Der rechte Teil gilt als Mittelteil und wird wechselnd wiederholt. |
| | |
| | <code typoscript> |
| | rot||orange |*| blau||grün |
| | </code> |
| | |
| | <html><span style="color:red;">eins,</span><span style="color:orange;">zwei,</span><span style="color:blue;">drei,</span><span style="color:green;">vier,</span><span style="color:blue;">fünf,</span><span style="color:green;">sechs,</span><span style="color:blue;">sieben</span></html> |
| |
| | ---- |
| ==== optionSplit mit stdWrap.split ==== | ==== optionSplit mit stdWrap.split ==== |
| | |