I don't get cropVariants working

Hallo, ich habe schon ziemlich alle Artikel zu cropVariants gelesen und vieles ausprobiert. Meine im Backend ausgewählten cropVarianten werden nicht gerendert. Abhängig vom Viewport werden unterschiedlich große Bilder erzeugt, das funktioniert. Füge ich aber ein cropVariante hinzu, wird das nicht berücksichtigt.

Die Varianten sind in TsConfig angelegt. Zum Rendern habe ich das Image-Partial angepasst. Hier die Dateien:

Hat jemand eine Idee? Außer <f:media… habe ich auch schon diverse Varianten wie ‘picture’ etc ausprobiert, immer das gleiche.

Allerdings zeigt mir debug {_all} auch nirgends einen Wert für cropVariant. Ist das ein Hinweis zur Lösung?
Leider ist in der Doku der Umgang mit den crop-Varianten nicht wirklich erklärt. Wenn ich wie dort gezeigt einfach einen festen Wert für cropVariant code, dann wird das auch gemacht. Die Variante muss aber mit dem Bild geliefert werden.
Or in English…
Hello, I’ve read quite a few articles on cropVariants and tried a lot of things. My cropVariants selected in the backend are not rendered. Depending on the viewport, different sized images are generated, which works. However, if I add a cropVariant, this is not taken into account.

The variants are created in TsConfig. I have adapted the image partial for rendering. Here are the files:

Does anyone have an idea? Apart from <f:media… I have also tried various variants such as etc, always the same.

However, debug {_all} does not show me a value for cropVariant anywhere. Is this a hint for the solution?

Unfortunately, the handling of crop variants is not really explained in the documentation. If I simply code a fixed value for cropVariant as shown there, then this is also done. However, the variant must be supplied with the image.


Hi Bernd!

Thank you for using talk.typo3.org!

My first hunch here would be that something is up with your TSConfig. Have you tried to implement the crop variants directly in TCA? Here’s an example in the Bootstrap Package.

To better help you, please let me know which TYPO3 version you are using.

PS! This is an English-language forum, so writing in English should be sufficient. :slight_smile:

I’m setting up a new site from the Scratch vith version 13.4.
I’ve learned that I coud either use TsConfig or TCA-overrides. For me the TsConfig was the easier way. I will try to implement in the TCA.
Thanks for the example.
Do I need to configure something to add the TCA-overrides or will it happen automatically?
I see that all sizes are set to default. And I have to add the settings for each content element of tt_content explicitly, right?

Now I used the TCA taken from the example. I changed the cropping of the image and also modified the partial using -picture-.
This is are my image.html and the variable-dump:


Hey :wave:
AFAIK… At the Backend… I think you have to “crop” the image …. It is not “automagicaly” doing it for you. If you don‘t you always get the “default”

Best,
Michael

1 Like