Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2014-07-12 02:29:40

claywso
Member
From: Durham, NC USA
Registered: 2004-12-20
Posts: 57
Website

txp:images confusion on article list

on a template for an article listing, i’m using an article form that contains a <txp:images /> tag. I’d like to have the listing page show multiple articles, and multiple article images for each article on that listing page..

so, for example, article 1 has article images 1,2,3 and article 2 has images 4,5,6. instead of each article only showing it’s own images, it’s showing images for ALL articles.

the page calls

<txp:article form="gallery" limit="99" />

here’s the article form:

  <div class="ef-post category-1 category-4">
   <div class="ef-post-inner">
    <div class="ef-proj-img">
     <ul class="ef-fadeshow" data-interval="3000">
      <txp:images auto_detect="article" break="li" thumbnail="1" form="gallery-images" />
     </ul>
	 <div class="ef-proj-desc">
	  <h4><txp:title /></h4>
	  <div class="ef-links-holder">
	   <txp:permlink class="ef-lnk icn-ef">Details</txp:permlink>
       <txp:images thumbnail="1" limit="1" form="gallery-enlarge" /><div style="display:none;"><txp:images offset="1" limit="2" form="gallery-enlarge-hidden" thumbnail="1" /></div>
	  </div>
	 </div>
    </div>
   </div>
  </div>

the gallery images form:

<img src="<txp:image_url thumbnail='1' />" />

Offline

#2 2014-07-12 06:26:48

milosevic
Member
From: Madrid, Spain
Registered: 2005-09-19
Posts: 390

Re: txp:images confusion on article list

Try to specify auto_detect=“article” in the three txp:images tags, you are only using it with the first one.


<txp:rocks/>

Offline

#3 2014-07-12 07:00:56

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

Re: txp:images confusion on article list

claywso wrote #282071:

so, for example, article 1 has article images 1,2,3 and article 2 has images 4,5,6. instead of each article only showing it’s own images, it’s showing images for ALL articles.

Hi claywso, Article images are what their name says that it is. One option would be to use a custom field and write the ids of the images you wish to show per article.


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

Offline

#4 2014-07-12 20:09:57

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,473

Re: txp:images confusion on article list

claywso wrote #282071:

so, for example, article 1 has article images 1,2,3 and article 2 has images 4,5,6 …

I suppose you’ve entered in each article_image field the image numbers, for example, for article 1 the numbers 1,2,3, for article two the numbers 4,5,6 etc. Yes or no?

Offline

#5 2014-07-14 20:14:28

claywso
Member
From: Durham, NC USA
Registered: 2004-12-20
Posts: 57
Website

Re: txp:images confusion on article list

@GugUser – you’re correct. that’s acceptable use, right?

@colak – what’s the difference? why would the article images be treated differently?

@milosevic – thanks, updated

however, i think that i narrowed down the problem to my jquery tool, not a textpattern issue. putting multiple image id’s in the article image field indeed works as it should. thank you!

Offline

#6 2014-07-15 15:05:22

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,473

Re: txp:images confusion on article list

claywso wrote #282123:

@GugUser – you’re correct. that’s acceptable use, right?

It works with <txp:images />, with <txp:article_image /> it shows only one image.

Offline

#7 2014-07-15 16:31:08

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

Re: txp:images confusion on article list

GugUser wrote #282160:

It works with <txp:images />, with <txp:article_image /> it shows only one image.

Instead of using article_image which only should only show one image, you could use <txp:custom_field name="article_image"/>. Something like:

<txp:images id='<txp:custom_field name="article_image"/>' limit="3"><txp:image /></txp:images>

It is undocumented but it works:)


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

Offline

Board footer

Powered by FluxBB