Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2021-09-15 09:51:40

John-Paul F
Member
Registered: 2021-03-15
Posts: 39
Website Twitter

Add thumbnail of article image

How to add a thumbnail of the article image for the latest post in this section? This is the code I’m using:

<txp:recent_articles limit="1" label="Latest Art" labeltag='h2' section="gallery" />

Most grateful in advance, kind people.


Strictly Amateur

Offline

#2 2021-09-15 11:39:10

etc
Developer
Registered: 2010-11-11
Posts: 4,517
Website GitHub

Re: Add thumbnail of article image

By default, <txp:recent_articles /> will output linked titles, processing:

<txp:permlink><txp:title no_widow="" /></txp:permlink>

To alter this default output, just use the tag as container:

<txp:recent_articles limit="1" label="Latest Art" labeltag='h2' section="gallery">
    <txp:permlink><txp:title no_widow="" /></txp:permlink>
    <txp:article_image thumbnail />
    <!-- whatever else -->
</txp:recent_articles>

Hope that works/helps.

Offline

#3 2021-09-15 12:51:04

John-Paul F
Member
Registered: 2021-03-15
Posts: 39
Website Twitter

Re: Add thumbnail of article image

Hope that works/helps.

It really does, thank you so much.


Strictly Amateur

Offline

Board footer

Powered by FluxBB