Hi Everyone!
I was wondering where i could change the setup for Pagelist Image Teaser Images beeing cached. Course I would like to use an animated Gif as the Teaser Image.

Cheers,
Dennis

  • mad replied to this.

    Dennis Hi there, animated GIFs are not supported by the caching engine. But if you don't define a teaser image, the pagelist uses the first image in the content without resizing or caching it.

      mad Thanks! Could I also disable the caching for teaser images?

      Great CMS by the way! Thanks for all the great work! 🙏

      • mad replied to this.
      • mad likes this.

        Dennis Thanks! 😊 The cachning for images can not be disabled since only resized images are saved to the cache. And they have to be saved somewhere. Images that are just embedded in a block are just linked as teaser images and not stored in the cache.

          mad Thanks for the Info! I tried to not define a teaser image and use a gif as the first image in the content area. That worked! But what if don't want to use that Gif in the content area? I my head that would just be an easy if / else to setup a new variable 'cache teaser image'. Am I wrong?

          • mad replied to this.

            Dennis Yes that would work. Basically you only have to remove the part in the templates where the teaser image is resized. Just use the URL as is should do the trick.

            thanks mad i managed to do so!

            i changed the code for "packages/standard/templates/snippets/set_imageteaser_variable.php" as followed:

            `<?php defined('AUTOMAD') or die('Direct access not permitted!'); ?>
            <# Reset variable to false in case there is no match. #>
            <@ set { :imageTeaser: false } @>
            <# Try to get image from variable. #>
            <@ with @{ imageTeaser | def ('*.jpg, *.png, *.gif') }~@>
            <@ set { :imageTeaser: @{ :file } } @>

            <@~ else ~@>
            <# Else try to get first image from content. #>
            <@ set { :imageTeaser:
            @{ +main |
            def (@{ textTeaser | markdown }) |
            def (@{ text | markdown }) |
            findFirstImage
            }
            } @>
            <@~ end @>`

            And now i realised GIFs are bigger than MP4 Videos. 😅

            Optimizing Animated GIFs by Converting to HTML5 Video

            Is there any plan to implement videos in the content blocks / teaser images any time soon? But maybe thats another discussion now..

            ps: my code isnt displayed as code. What am I doing wrong?

            • mad replied to this.
            • mad likes this.

              Dennis Yeah gifs are huge. 😉 It is all a bit depending on the theme in use. You can also modify the teaser to show videos directly.

              And I think you have to just indent your snippet to make it show up as a block of code here.

              Newest Discussions