Featured content threads do not show featured image when displayed as Carousel

Mr Lucky

Well-known member
Affected version
2.3.0.RC3
Featured content with an image chosen (either linked or image in first post) does not show the image when it's a Carousel. It shows the user's Avatar instead. The might be a good as an alternative, but if you choose an image to feature, it should stick with that whatever format widget.

I can't imagine it would be designed like that because if you want a specific image that's what you need. If you want an avatar, then that is what you need.
 
Last edited:
+1 very unintuitive, took some time to realize the chosen image only displays (and even doesn't scale correctly) when using the standard view mode, while you would expect it to at least show in the carousel mode.

This way we still need an add-on, as the intention was to migrate over to native functionality...
 
Is there any template edit that I can do to enable this.

Nobody wants to see my Avatar in all the featured threads, esp when there is a featured image upload feature available. Looks rather boring esp if all featured threads in the carousel are by the same user.
 
Edit featured_content_item template

Find the macro id of carousel block. Replace the following line
Code:
        <xf:avatar user="$feature.ContentUser" size="m" defaultname="{$feature.content_username}" notooltip="true" />

With this:
Code:
<xf:if is="$feature.image">
    <a href="{$feature.content_link}" class="articlePreview-image" tabindex="-1" style="display: block; width: 120px; height: 120px; overflow: hidden;">
        <img src="{$feature.image}" alt="{$feature.title}" loading="lazy" style="width: 100%; height: 100%; object-fit: cover;" />
    </a>
<xf:else />
    <xf:avatar user="$feature.ContentUser" size="m" defaultname="{$feature.content_username}" notooltip="true" />
</xf:if>
 
Back
Top Bottom