| Beide Seiten, vorherige ÜberarbeitungVorherige ÜberarbeitungNächste Überarbeitung | Vorherige Überarbeitung |
| typo3:about:functions:optionsplit [2014/01/16 21:08] – [optionSplit] admin | typo3:about:functions:optionsplit [2017/12/05 21:37] (aktuell) – [Beispiele] admin |
|---|
| * Innerhalb der Subparts ''||'' hat am Anfang und in der Mitte der erste Eintrag Vorrang, am Ende wird zuerst der letzte Eintrag verwendet. | * 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. | * 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 ==== | ==== 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 === | === Drei Teile: je einmal Anfang und Ende, der mittlere Teil wird wiederholt === |
| |
| <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> | <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> |
| |
| ---- | ---- |