Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-02-15 21:46:41

caruso_g
Member
From: Catania
Registered: 2009-04-11
Posts: 88
Website

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

#3 2011-02-16 00:40:00

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

Re: How to show a hr every two images

Maybe zem_nth could help?


My Plugins

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

Offline

Board footer

Powered by FluxBB