Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
<txp:article_image_url>
I know it’s kind of doable with ump_image and a couple of other plugins, but it would be really handy to have a core TXP tag for <txp:article_image_url>
, since we already have one for <txp:image_url>
.
Offline
Re: <txp:article_image_url>
philwareham wrote:
it would be really handy to have a core TXP tag for
<txp:article_image_url>
I think this is equivalent:
<txp:images>
<txp:image_url />
</txp:images>
The images tag defaults to reading its context from the article image field — and will honour any list if it contains a comma-separated list of IDs. If you’re not sure if the article image is going to contain something you can wrap that lot in <txp:if_article_image>
.
Last edited by Bloke (2011-06-23 15:09:55)
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
Re: <txp:article_image_url>
that doable without a plugin but need more tag:
<txp:images auto_detect="article"><txp:image_url /></txp:images>
Cheers
PS: bloke beat me today ;)
Last edited by Dragondz (2011-06-23 15:10:45)
Offline
Re: <txp:article_image_url>
This also works:
<txp:image_url id='<txp:custom_field name="article_image" />' />
TXP Builders – finely-crafted code, design and txp
Online
Re: <txp:article_image_url>
jakob wrote:
<txp:image_url id='<txp:custom_field name="article_image" />' />
Forgot about that cheat. I like the cut of your jib, sir.
EDIT: though that’ll only work (uhh, I think, haven’t tried) if there’s one image ID.
Last edited by Bloke (2011-06-23 15:18:10)
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
Re: <txp:article_image_url>
Great thinking ‘outside the box’ there (for want of a better phrase). Thanks people.
Offline
Re: <txp:article_image_url>
though that’ll only work if there’s one image ID.
Yep, you’re right. For a comma-separated list of image IDs, you can use rah_repeat or your very own smd_each:
<ul>
<txp:rah_repeat value='<txp:custom_field name="article_image" />'>
<li><a href="<txp:image_url id='<txp:rah_repeat_value />' />" rel="lightbox"><txp:thumbnail id='<txp:rah_repeat_value />' /></a></li>
</txp:rah_repeat>
</ul>
Last edited by jakob (2011-06-23 22:39:50)
TXP Builders – finely-crafted code, design and txp
Online