Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2013-11-25 22:28:10

funtoosh
Member
From: Münster, Germany
Registered: 2006-10-09
Posts: 153
Website

[SOLVED] txp:images w/ auto_detect=article displaying ALL images ...

Hey there,
here’s what I was trying to do: use txp:images instead of txp:article_image to display multiple article images (specified as a comma-separated list in the article images field).

In my default article form I’ve got …

<txp:images form="articleImages" auto_detect="article" />

… with the form containing:

<img src='<txp:image_url thumbnail="1" />' alt='<txp:image_info type="alt" />' />
<figcaption itemprop="caption"><txp:image_info type="caption" /></figcaption>

Works like a charm for one or more entries in the article images field. However, when no image is specified, all my images are being displayed.
How would I stop this from happening??

Cheers,
-f

Last edited by funtoosh (2013-11-27 16:48:35)

Offline

#2 2013-11-25 23:35:53

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: [SOLVED] txp:images w/ auto_detect=article displaying ALL images ...

Wrap it in an <txp:if_article_image/> tag. That’s what I do.


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#3 2013-11-27 16:46:19

funtoosh
Member
From: Münster, Germany
Registered: 2006-10-09
Posts: 153
Website

Re: [SOLVED] txp:images w/ auto_detect=article displaying ALL images ...

Ah well, of course, that one does the trick.

Merci bien!
-f

Offline

Board footer

Powered by FluxBB