Hallo Bernd, die Geschichte mit CASE hatte ich schon auf dem Schirm, aber mir war/ist nicht klar, wie ich das Script aufbauen muss.
Hiermit klappt es aber leider auch nicht. Wenn ich dieses Script einsetze, werden die Bildgrößen gar nicht mehr berechnet. tt_content.image.20.1.file { width { override.cObject = CASE override.cObject { key.field = layout 1 = TEXT 1.value = 320c-0 2 = TEXT 2.value = 100c-0 } } height .... and so on } Viele Grüße, Lars Brinkmann Am 13. März 2015 um 10:25 schrieb bernd wilke <t...@bernd-wilke.net>: > Am 13.03.15 um 07:58 schrieb Lars Brinkmann: > >> Hallo Liste, >> >> über das Layoutfeld des Inhaltselements "Bild" möchte ich die >> Bildgröße steuern. Ursprünglich hatte ich dazu folgendes TypoScript >> verwendet: >> >> tt_content.image.20.1.file { >> width { >> override.if.value.field = layout >> override.if.equals = 1 >> override = 480c-0 >> } >> height { >> override.if.value.field = layout >> override.if.equals = 1 >> override = 320c-0 >> } >> } >> >> Das funktioniert auch prima. Nun soll für "layout" noch ein weiterer >> Wert hinzukommen, evtl. später auch mal ein dritter Wert. Bislang habe >> ich es so gelöst: >> >> tt_content.image.20.1.file { >> width { >> override.if.value.field = layout >> override.if.equals = 1 >> override = 480c-0 >> override.if.equals = 2 >> override = 200c-0 >> } >> height { >> override.if.value.field = layout >> override.if.equals = 1 >> override = 320c-0 >> override.if.equals = 2 >> override = 200c-0 >> } >> } >> >> Das funktioniert auch, > > > das kann so nicht funktionieren. deine zweiten Angaben überschreiben nämlich > die ersten. Final hast du eigentlich nur: > > tt_content.image.20.1.file { > width { > override.if.value.field = layout > override.if.equals = 2 > override = 200c-0 > } > height { > override.if.value.field = layout > override.if.equals = 2 > override = 200c-0 > } > } > jetzt funktioniert dein layout2, aber das layout1 ist tot. > >> ist aber keine saubere und elegante Lösung. Ich >> müsste also irgendwie ein CASE-Objekt da rein bringen. Wird "layout" > > > das hast du schon richtig erkannt. Anderenfalls müsstest du ineinander > geschachtelte override/ifs nutzen. sehr hässlich und umständlich. > >> nicht verändert, sollen die Standard-Einstellungen. Hier stehe ich >> aber im Moment auf dem Schlauch. Weiß jemand Rat? > > > nutze doch einfach ein CASE[1], das Typoscript Pendant zum PHP switch. > > t_content.image.20.1.file { > width { > override.cObject = CASE > override.cObject { > key.field = layout > 1 = TEXT > 1.value = 320c-0 > 2 = TEXT > 2.value = 200c-0 > } > } > } > > [1] > http://docs.typo3.org/typo3cms/TyposcriptReference/ContentObjects/Case/Index.html > > > bernd > -- > http://www.pi-phi.de/cheatsheet.html > > _______________________________________________ > TYPO3-german mailing list > TYPO3-german@lists.typo3.org > http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-german -- brinkmann.l...@gmail.com _______________________________________________ TYPO3-german mailing list TYPO3-german@lists.typo3.org http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-german