Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-02-02 16:25:41

element
Member
Registered: 2009-11-18
Posts: 99

url of article image

Am I missing something?
I just need the url of an article image (only the http://-part), not the whole html <img>-tag shabang that comes with it. How do I do it?

Offline

#2 2011-02-02 16:33:18

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,943
Website GitHub

Re: url of article image

element wrote:

I just need the url of an article image (only the http://-part)

If you’re running TXP 4.3.0, take your pick from either:

<txp:images><txp:image_url /></txp:images>

or the cheating method:

<txp:image_url id='<txp:custom_field name="article_image" /> ' />

The first one’s (probably) more efficient. Hope that helps.

Last edited by Bloke (2011-02-02 16:34:36)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#3 2011-02-02 16:41:38

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

Re: url of article image

why don’t you use a custom field?

Edit: check bloke’s answer:)

Last edited by colak (2011-02-02 16:43:13)


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

Online

#4 2011-02-02 16:45:16

element
Member
Registered: 2009-11-18
Posts: 99

Re: url of article image

Thanks Bloke, you’re great!
The cheating method works, the other one doesn’t because I’m using multiple article images per article.
Luckily I’m using TXP 4.3.0, the new image-tags in 4.3.0 are very welcome. :-)

Offline

Board footer

Powered by FluxBB