Hi,

ich habe ein Fluid cObject, das die UID eines Bildes bekommt und damit
ein Typoscript Bild rendert.
Das funktioniert auch wunderbar, bis auf den altText und title.
Hier steht in der Frontend-Ausgabe: Error: no file object
Ich denke das hat was mit file.import.current zu tun... vermutlich ein
Verständnisproblem der TS Syntax.

Hier der Fluid Aufruf:
<f:cObject typoscriptObjectPath="lib.responsiveImage" data="{image.uid}"
></f:cObject>

Und das Typoscript:
lib.responsiveImage = IMAGE
lib.responsiveImage {
        file {
                import.current = 1
                treatIdAsReference = 1
        }
        altText = file:current:alternative
        titleText = file:current:title

        sourceCollection {
            xlarge {
              width = 5000m
              srcsetCandidate = 5000w
              mediaQuery = (min-width: 2001px)
              dataKey = xlarge
        }
        large {
              width = 2000m
              srcsetCandidate = 2000w
              mediaQuery = (min-width: 1024px) and (max-width: 2000)
              dataKey = large
        }
            medium {
              width = 1024
              srcsetCandidate = 1024w
              mediaQuery = (min-width: 769px) and (max-width: 1024)
              dataKey = large
        }
        small {
          width = 768
          srcsetCandidate = 768w
          mediaQuery = (max-width: 768px)
          dataKey = small
        }
    }
        layout < tt_content.image.20.1.layout
        layoutKey = {$styles.content.imgtext.layoutKey}
}

Ergibt im Frontend:

<img title="Error: no file object" alt="Error: no file object"
srcset="/fileadmin/slider/Testslider_Bild.jpg
5000w,/fileadmin/_processed_/csm_Testslider_Bild_cb1125a3ed.jpg
2000w,/fileadmin/_processed_/csm_Testslider_Bild_1761a5fff8.jpg
1024w,/fileadmin/_processed_/csm_Testslider_Bild_52e34d3189.jpg 768w"
src="/fileadmin/slider/Testslider_Bild.jpg" style="max-width: 100%; top:
-5.36278%; left: 0px;">

Debug vom Fluid image passt, {image.alternative} enthält den richtigen
Alt-Text. Finde aber keine Möglichkeit das einfach ans cObject zu
übergeben. Also muss ich es im cObject laden, oder?
Mir reicht auch schon ne Idee wie ich da weiter komme, muss kein
fertiges TS sein.

LG Andrea
_______________________________________________
TYPO3-german mailing list
TYPO3-german@lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-german

Antwort per Email an