Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2015-01-31 17:51:12

Freeant
Member
Registered: 2012-04-16
Posts: 36

How to display only the first image from the article

Form default

...
<txp: permlink> <txp: title /> </ txp: permlink>
<?>
...

How to make the display (output) only the first image of the article.

Offline

#2 2015-01-31 17:58:15

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,011
Website GitHub Mastodon Twitter

Re: How to display only the first image from the article

You could use article image

something like <txp: permlink><txp:article_image /></ txp: permlink>


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#3 2015-01-31 21:46:02

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,137
GitHub

Re: How to display only the first image from the article

Freeant – are you removing the spaces from your tag code?

You write this:

<txp: permlink> <txp: title /> </ txp: permlink>

…when the recommended way is more compact:

<txp:permlink><txp:title /> </txp:permlink>

Offline

#4 2015-01-31 22:53:15

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: How to display only the first image from the article

Not just recommended… it won’t work with those spaces in there.

Offline

#5 2015-02-01 11:01:28

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,137
GitHub

Re: How to display only the first image from the article

ruud wrote #287958:

Not just recommended… it won’t work with those spaces in there.

That was my gut feeling – I was away from a Textpattern instance to test ‘em out properly.

Offline

Board footer

Powered by FluxBB