Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#37 2009-08-28 22:05:41

decoderltd
Member
From: London
Registered: 2006-06-20
Posts: 248
Website

Re: List problem

Thanks again Els, Jonathan + Bloke,

That’s working perfectly now, it never occurred to me about nulling the break attribute like that. I also assumed it was empty by default and would possibly make more sense if it was.

I’m off to take a look at the goodies in TXP 4.2.0 now – great to see a new upgrade.

Last edited by decoderltd (2009-08-28 22:24:53)

Offline

#38 2009-09-08 10:46:35

decoderltd
Member
From: London
Registered: 2006-06-20
Posts: 248
Website

Re: List problem

Sorry guys, one final question.

Following on from the list code you kindly helped me with, I’m trying to create the same technique for a link list. I thought I had this worked out but using the code below is creating repetition of the links. I think this may be from having two linklist tags but I can’t think of another way around it.

<txp:linklist break="">
 <txp:variable name="has_link" value='<txp:link_category />' />
      <txp:if_variable name="has_link" value="">
         <txp:else />
         <div class="module">
            <h4><txp:link_category title="1"/></h4>
            <txp:linklist category='<txp:link_category />' wraptag="ul" class="listing" break="li">
               <txp:permlink><txp:link /></txp:permlink><br />
               <txp:link_description />
            </txp:linklist>
         </div><!-- end module -->
      </txp:if_variable>
</txp:linklist>

Offline

#39 2009-09-08 11:15:23

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: List problem

Off the top of my head:

<txp:category_list type="link" break="">
	<txp:variable name="has_links" value='<txp:linklist category=''<txp:category />'' limit="1" />' />
	<txp:if_variable name="has_links" value="">
	<txp:else />
		<div class="module">
		<h4><txp:category title="1" /></h4>
		<txp:linklist category='<txp:category />' wraptag="ul" class="listing" break="li">
			<txp:link /><br />
			<txp:link_description />
		</txp:linklist>
		</div><!-- end module -->
	</txp:if_variable>
</txp:category_list>

If you ever need a similar code for files as well, see this tip on TXP Tips :)

Offline

#40 2009-09-08 11:55:03

decoderltd
Member
From: London
Registered: 2006-06-20
Posts: 248
Website

Re: List problem

Perfect! Thanks again Els, really appreciate your help.

Offline

Board footer

Powered by FluxBB