Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-07-31 17:46:21

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

if_different div creation

i’ve created a long set of list items, and the only thing that separates them visually is the if_different tag (breaks apart the month). but since they are separated using this tag, i also want to wrap them in div tags too.


<txp:article_custom>
<txp:if_different>
<h3><txp:posted format="%B" /></h3>
</txp:if_different>
<li>
<a href="<txp:file_download_link id="<txp:custom_field name="file_number" />" />" " class="inline-playable">
<txp:title /><span><txp:posted  format = "%B %d"/></span></a>
</li>
</txp:article_custom>

now if i place a wrapper outside this snippet like #monthView, all the <li>s above will share the same instance of that div and are not separated properly.

so i came up with:

<txp:article_custom limit="999" section="daily">
<txp:if_different>  <!-- look here -->
<div class='month <txp:posted format="%B" />'> 
</txp:if_different>
<txp:if_different>
<h3><txp:posted format="%B" /></h3>
</txp:if_different>
<li>
<a href="<txp:file_download_link id="<txp:custom_field name="file_number" />" />" " class="inline-playable">
<txp:title /><span><txp:posted  format = "%B %d"/></span></a>
</li>
<txp:if_different> <!-- look here -->
<p style="display:none"><txp:posted format="%B" /></p> 
</div>
</txp:if_different>
</txp:article_custom>

this is actually getting quite close, but it ends the div after the first li in the month. as you can see i might not be using the tag properly since i’m using <txp:posted> to trigger it in every scenario.

also is there a plugin that’s similar too? this kind of functionality is wildly useful for the way i sort content.

Offline

#2 2010-07-31 19:39:06

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

Re: if_different div creation

in the meantime i am going after upm_date_archive

Offline

Board footer

Powered by FluxBB