MG 2.1 Media Gallery RSS Show Thumbnail instead of full image?

dotpro

Active member
Hi,

Is it possible to show thumbnail of the item in media gallery RSS feed instead of the full image?



Code:
<xf:if is="$mediaItem">
    <p>
        <xf:if is="$mediaItem.media_type == 'image'">
            <img src="{{ link('canonical:media/full', $mediaItem, {'d': $mediaItem.last_edit_date ?: null}) }}" alt="{$mediaItem.title}" width="500" />
        <xf:elseif is="$mediaItem.media_type == 'video'" />
            <video width="500">
                <source src="{$mediaItem.getVideoUrl(true)}" type="video/mp4" />
            </video>
        <xf:elseif is="$mediaItem.media_type == 'audio'" />
            <audio>
                <source src="{$mediaItem.getAudioUrl(true)}" type="audio/mpeg" />
            </audio>
        <xf:elseif is="$mediaItem.media_type == 'embed'" />
            {{ bb_code($mediaItem.media_tag, 'xfmg_media', $mediaItem) }}
        </xf:if>
    </p>
    <xf:if is="$mediaItem.description">
        <p>{{ structured_text($mediaItem.description) }}</p>
    </xf:if>
    <p>
        <a href="{{ link('canonical:media', $mediaItem) }}" target="_blank">{{ phrase('xfmg_view_this_media_item') }}</a>
    </p>
</xf:if>


In XF1, this worked
Code:
{xen:helper fullurl, $media.thumbnailUrl, true}
 

dotpro

Active member
Anyone? I posted about this same issue/feature back in 2015.


If RSS has the FULL image then that defeats the purpose of having an RSS feed and doesn't really give the users using the rss feed in their feed reader a reason to visit the site. Not an ideal behavior. Need to show thumbnail and link that to the actual full image on the website.
 

dotpro

Active member
I managed to figure this one out, not sure if its correct but thumbnail shows up in RSS feed now

Code:
            <img src="{{ link('canonical:media/full', $mediaItem, {'d': $mediaItem.last_edit_date ?: null}) }}" alt="{$mediaItem.title}" width="500" />

to
Code:
            <img src="{$mediaItem.getCurrentThumbnailUrl(true)}" alt="{$mediaItem.title}" width="500" />
 
Top