Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
How to show a hr every two images
Hi, I need to insert a <hr/>
every two images into an article. I fetch images from a specific category by using a custom field.
The problem is that on even images it is perfect (e.g. on six or eight images), while on odd ones (five) I get the first image as if it were the second of the first “row” and two couple of images beneath. I hope it is clear, I am sorry I can’t show you the website since I am working under NDA, but I put a screenshot here.
The article code is:
<txp:if_variable name="alphaOmega" value="alpha">
<txp:variable name="alphaOmega" value="omega" />
<txp:else />
<txp:variable name="alphaOmega" value="alpha" />
</txp:if_variable>
<li class="grid_4 <txp:variable name="alphaOmega" />">
<h5 id='feature-<txp:image_info type="id" />'><txp:image_info type="alt" /></h5>
<p>
<a href="<txp:image_url />" class="feature grid_1 alpha" rel="feature" title='<txp:image_info type="alt" />'><txp:thumbnail escape="html" /></a>
<txp:upm_textile><txp:image_info /></txp:upm_textile>
</p>
</li>
<txp:if_variable name="alphaOmega" value="omega">
<hr />
</txp:if_variable>
While the form code is:
<h4 id='<txp:title />'><txp:title /></h4>
<txp:excerpt />
<txp:if_custom_field name="screenshotsCategory" >
<txp:images category='<txp:custom_field name="screenshotsCategory" />' sort="name asc" wraptag="ul" html_id="screenshots_thumbs" break="li" form="bs_screenshots_thumbs" />
<txp:images category='<txp:custom_field name="screenshotsCategory" />' sort="category asc" wraptag="ul" html_id="screenshots" break="li" form="bs_screenshots" />
</txp:if_custom_field>
<txp:if_custom_field name="featuresCategory" >
<txp:images category='<txp:custom_field name="featuresCategory" />' sort="name asc" wraptag="ul" html_id="features" break="" form="bs_products_features" />
</txp:if_custom_field>
<txp:body />
Offline
#2 2011-02-15 23:25:48
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: How to show a hr every two images
It looks like the variable’s value has already been set to ‘alpha’. I suppose you are not using the same variable somewhere else on the page?
Did you have a look at the tag trace to see if it tells you anything?
Offline
Re: How to show a hr every two images
Maybe zem_nth could help?
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
Pages: 1