[TYPO3-german] T3 6.1 | Bildzuschnitt und Bildgröße

Marco Brüggemann marco at schauart.de
Tue Nov 26 09:36:57 CET 2013


Am 25.11.2013 08:47, schrieb bernd wilke:
> Am 22.11.13 15:33, schrieb Marco Brüggemann:
>> Am 18.11.2013 10:26, schrieb bernd wilke:
>>> Am 15.11.13 20:19, schrieb Marco Brüggemann:
>>>> Am 15.11.2013 13:10, schrieb bernd wilke:
>>>>> Am 15.11.13 12:47, schrieb Marco Brüggemann:
>>>>>> Guten Tag,
>>>>>>
>>>>>> Für meine Inhaltselemente mit Bildern möchte ich die Breite der
>>>>>> Vorschaubilder auf die jeweilige Beite des Contentelemens 
>>>>>> beschränken.
>>>>>>
>>>>>> Dazu habe ich in den TS-Konstanten zuerst die Breiten der
>>>>>> Contentelemente definiert:
>>>>>>
>>>>>> #-----------------------------------------------------------
>>>>> [...]
>>>>>> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>>>>>> Ich würde auch gerne den Zuschnitt der Bilder so für jeden
>>>>>> Contentbereich beeinflussen. geht das?
>>>>>> Ich benutze dafür zur zeit das:
>>>>>>
>>>>>> tt_content.image.20.1.maxH >
>>>>>> tt_content.image.20.1.maxW >
>>>>>> tt_content.image.20.1.file.width >
>>>>>> tt_content.image.20.1.file.height >
>>>>>> tt_content.image.20.equalH >
>>>>>> tt_content.image.20.equalW >
>>>>>> tt_content.image.20.1.maxH = 525
>>>>>> tt_content.image.20.1.maxW = 150
>>>>>> tt_content.image.20.1.file.width = 525c-0
>>>>>> tt_content.image.20.1.file.height = 150c-0
>>>>>>
>>>>>> kann ich das auch in Abhähngigkeit von
>>>>>> "Datenbank/tt_content/section_frame" in unterschiedliche Breiten
>>>>>> schneiden?
>>>>>
>>>>> da gäbe es mehrere Möglichkeiten:
>>>>> 1. explizit ausrechnen
>>>>> ...maxW.cObject = TEXT
>>>>> ...maxW.cObject {
>>>>>     prioriCalc = 1
>>>>>     value = ({frame_section}-29)*120
>>>>>     insertData = 1
>>>>> }
>>>>>
>>>>> 2. CASE
>>>>> ...maxW.cObject = CASE
>>>>> ...maxW.cObject {
>>>>>     key.field = frame_section
>>>>>
>>>>>     30 = TEXT
>>>>>     30.value = 120
>>>>>
>>>>>     :
>>>>>
>>>>>     35 = TEXT
>>>>>     35.value = 920
>>>>> }
>>>>>
>>>>> 3. das gleiche nur komplizierter abgefragt:
>>>>> ...maxW.cObject = COA
>>>>> ...maxW.cObject {
>>>>>
>>>>>     10 = TEXT
>>>>>     10.value = 120
>>>>>     10.if.equals.field = frame_section
>>>>>     10.if.value = 30
>>>>>
>>>>>     :
>>>>>
>>>>> }
>>>>>
>>>>> evtl. wäre es auch sinnvoll solche Werte erstmal in den Constants 
>>>>> oder
>>>>> Registerwerten abzulegen statt sie an mehreren Stellen jeweils
>>>>> ausrechnen zu lassen
>>>>>
>>>>> bernd
>>>>
>>>> Hallo Bernd .. vielen Dank für Deine hilfe ... leider klappt es aber
>>>> noch nicht: ($grid1.srg ist als Kontante mit 120 hinterlegt)
>>>>
>>>> Dieses hier ergibt eine Ausgabe, jedoch sind die Bilder alle zu 100%
>>>> Groß:
>>>> tt_content.image.20.1.file.width = TEXT
>>>> tt_content.image.20.1.file.width {
>>>>          prioriCalc = 1
>>>>      value = ({frame_section}-29)*{$grid1.srg}
>>>>      insertData = 1
>>>>      wrap = |c-0
>>>> }
>>>> tt_content.image.20.1.file.height = TEXT
>>>> tt_content.image.20.1.file.height {
>>>>          prioriCalc = 1
>>>>      value = ({frame_section}-29)*{$grid1.srg}
>>>>      insertData = 1
>>>>      wrap = |c-0
>>>> }
>>>>
>>>> mache ich ein "tt_content.image.20.1.file.width.cObject" daraus, wird
>>>> gar nichts mehr ausgegeben.
>>>>
>>>> Was für ein Wert jetzt wirklich in tt_content.image.20.1.file.height
>>>> steht, kann ich leider auch nicht überprüfen - eigentlich sollte dort
>>>> bei frame_section=30 (30-29)*120= 120 ---> gewrapt ---> 120c-0 stehen,
>>>> da aber das Bild immer 100% groß ist, denke ich mal, dass das nicht so
>>>> errechnet und zusammengebaut wird.
>>>>
>>>> Kann man den Wert gezielt mit so etwas ähnlichem wie "var_dump"
>>>> auswerfen?
>>>
>>>
>>> du kannst natürlich den Wert als Kopie ausgeben, bzw als kopie in
>>> .height reinschreiben.
>>>
>>>
>>> temp.hoehe = TEXT
>>> temp.hoehe {
>>>     prioriCalc = 1
>>>     value =
>>>     :
>>> }
>>>
>>> //benutzen
>>> tt_content.image.20.1.file.width < temp.hoehe
>>>
>>> // debug ausgabe:
>>> page.99 < temp.hoehe
>>>
>>>
>>> du kannst natürlich auch das admin-panel benutzen um zu überprüfen was
>>> überhaupt an typoscript auf der Seite im FE aktiv ist.
>>>
>>> bernd
>>
>> Hallo Bernd,
>>
>> vielen Dank noch einmal für deine Antwort.
>> Dieses Verfahren, so wie Du es vorschlägst, funktioniert irgendwie 
>> nicht.
>> Als errechneter Wert kommt  -4641 heraus und das Bild wird in
>> Originalgröße angezeigt.
>>
>> Daher meine Frage:
>> Kann es sein, dass es zwei verschiedene Bereiche sind, die "nicht
>> miteinander können"?
>>
>> Einerseit die allgemeinen Bildeinstellungs-Konstanten (wie zum 
>> Beispiel):
>> tt_content.image.20.1.file.width = 300c
>> tt_content.image.20.1.file.height = 150c-50
>>
>> und andererseits spezifische Bildgestaltungsmittel des jeweiligen
>> Kontentelements?
>> tt_content.stdWrap {
>>   innerWrap.cObject = CASE
>>   innerWrap.cObject {
>>          30 =< tt_content.stdWrap.innerWrap.cObject.default
>>          30.20.10.value = {field:CType} grid1 layout-{field:layout}
>> imgori-{field:imageorient}
>>          30.20.10.insertData = 1
>>       }
>> }
>>
>> ich möchte ja in Abhängigkeit von dem Wert in [tt_content ->
>> section_frame], und diese Wert ist ja von Beitrag zu Beittrag ev.
>> unterschiedlich, das Bild zuschneiden:
>> tt_content.image.20.1.file.width = [{section_frame} und der daraus
>> resultierende Wert der Bildbreite]["c" noch ranhängen]
>>
>> schreibe ich das so:
>> temp.hoehe = TEXT
>> temp.hoehe {
>>      prioriCalc = 1
>>      value =
>>      :
>> }
>>
>> dann weis ich nicht, wie ich auf den conten-spezifischen Wert
>> "section_frame" zugreifen soll. woher soll er auch wissen, dass ich
>> einen spezifischen Beitrag meine? Daher der ungewünschte errechnete 
>> Wert.
>
> ausgewertet wird das ganze ja wenn ein tt_content-record gerendert 
> wird, und zu diesem zeitpunkt gibt es immer genau einen Wert.
>
>>
>> temp.hoehe = TEXT
>> temp.hoehe {
>>      prioriCalc = 1
>>      value = (({frame_section}-29)*{$grid1.srg})+({$spaltenabstand.srg}
>> * ({frame_section}-29))-1
>>      insertData = 1
>> }
>>
>> page.99 < temp.hoehe ---> -4641
>
> wenn du natürlich das temp.hoehe auf page.99 kopierst gibt es diese 
> Zuordnung nicht. nur wenn temp.hoehe irgendwo innerhalb von tt_content 
> einkopiert wird.
>
>> Erklärung:
>> ({frame_section}-29) - es gibt 6 relevante, aufeinanderfolgende Werte
>> für frame_section: 30 oder 31 oder 32, 33, 34, 35
>> so dass in der Berechnung dann 1 - 6 herauskommt.
>> {$grid1.srg} - Ist der Wert für die schmalste Spalte - ist 1/6 von
>> {$grid6.srg
>> {$spaltenabstand.srg} - ist der Abstand zwischen zwei Spalten
>>
>> --------------------------------------------------------------------------------------------------------------- 
>>
>>
>> Ich glaube ich muss dort anpacken, wo ich definiere: "Wenn
>> {frame_section = 30 [ oder 31 ...] dann schreibe in das div die Klasse:
>> grid1"
>>
>> die mache ich hier:
>>
>> tt_content.stdWrap {
>>   innerWrap.cObject = CASE
>>   innerWrap.cObject {
>>          30 =< tt_content.stdWrap.innerWrap.cObject.default
>>          30.20.10.value = {field:CType} grid1 layout-{field:layout}
>> imgori-{field:imageorient}
>>          30.20.10.insertData = 1
>>
>>          [und so weiter]
>>   }
>> }
>>
>> dort müste jetzt noch rein:
>> "Wenn {frame_section = 30 [ oder 31 ...] dann schreibe in das div die
>> Klasse: grid1 UND Konstanteneinstellung ist:
>> tt_content.image.20.1.file.width = {$grid1.srg}c"
>
> für "wenn" gibt es in typoscript mehrere Konstrukte:
> .if
> .override
> .ifempty
> CASE
>
> da es hier meherere werte gibt würde ich wohl CASE nutzen.
>
> bernd


Hallo Bernd

Danke für deine Geduld!

Es klappt immer noch nicht. Meine letzte von bestimmt 100 Varianten ist 
jetzt diese:

temp.bildbreite = CASE
temp.bildbreite {
     key.cObject = TEXT
     key.cObject.dataWrap = {field:section_frame}-29
     key.prioriCalc = 1
     default = TEXT
     default.value = 150
     1 = TEXT
     1.value = {$grid1.srg}
     2 = TEXT
     2.value = {$grid2.srg}
     3 = TEXT
     3.value = {$grid3.srg}
     4 = TEXT
     4.value = {$grid4.srg}
     5 = TEXT
     5.value = {$grid5.srg}
     6 = TEXT
     6.value = {$grid6.srg}
}

tt_content.image.20.1.maxH >
tt_content.image.20.1.maxW >
tt_content.image.20.1.file.width >
tt_content.image.20.1.file.height >
tt_content.image.20.equalH >
tt_content.image.20.equalW >
tt_content.image.20.1.maxH >
tt_content.image.20.1.maxW >
tt_content.image.20.1.file.width < temp.bildbreite
tt_content.image.20.1.file.height = 150c-50

aber selbst die Ausgabe:

page.99 < temp.bildbreite

... zeigt nichts an.

Ich vermute, dass "tt_content.image.20.1." nicht auf {field:section_frame}

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
- - - - - - - - - - - -
hier klappt es:

tt_content.stdWrap {
  innerWrap.cObject = CASE
  innerWrap.cObject {
         30 =< tt_content.stdWrap.innerWrap.cObject.default
         30.20.10.value = {field:CType} grid1 layout-{field:layout} 
imgori-{field:imageorient} frame_section-{field:section_frame}
         30.20.10.insertData = 1

         31 =< tt_content.stdWrap.innerWrap.cObject.default
         31.20.10.value = {field:CType} grid2 layout-{field:layout} 
imgori-{field:imageorient} frame_section-{field:section_frame}
         31.20.10.insertData = 1

         32 =< tt_content.stdWrap.innerWrap.cObject.default
         32.20.10.value = {field:CType} grid3 layout-{field:layout} 
imgori-{field:imageorient} frame_section-{field:section_frame}
         32.20.10.insertData = 1

         33 =< tt_content.stdWrap.innerWrap.cObject.default
         33.20.10.value = {field:CType} grid4 layout-{field:layout} 
imgori-{field:imageorient} frame_section-{field:section_frame}
         33.20.10.insertData = 1

         34 =< tt_content.stdWrap.innerWrap.cObject.default
         34.20.10.value = {field:CType} grid5 layout-{field:layout} 
imgori-{field:imageorient} frame_section-{field:section_frame}
         34.20.10.insertData = 1

         35 =< tt_content.stdWrap.innerWrap.cObject.default
         35.20.10.value = {field:CType} grid6 layout-{field:layout} 
imgori-{field:imageorient} frame_section-{field:section_frame}
         35.20.10.insertData = 1
  }
}

Ich vermute, dass "tt_content.stdWrap.innerWrap.cObject" auf 
{field:section_frame} zugreifen kann.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
- - - - - - - - - - - -
Mein Problem ist also, dass ich von dort, wo ich auf 
{field:section_frame} zugreifen kann irgendwie die 
Bildbreiteneinstellungen verändern muss.
Aber so funktioniert es sicher nicht:

tt_content.stdWrap {
  innerWrap.cObject = CASE
  innerWrap.cObject {
         30 =< tt_content.stdWrap.innerWrap.cObject.default
         30.20.10.value = {field:CType} grid1 layout-{field:layout} 
imgori-{field:imageorient} frame_section-{field:section_frame}
         30.20.10.insertData = 1
         30 {
             tt_content.image.20.1.file.width < temp.bildbreite
         }
         .
         .
         .
  }
}

Irgendwo muss doch beim Rendern des Contents die Stelle kommen, wo TS 
auf die Breiteneinstellungen für Bilder zugreift. Muss ich genau dort 
ansetzen?

Gruß,
Marco.


More information about the TYPO3-german mailing list