Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-08-09 16:33:04

NicChen00
Member
From: Edmonton
Registered: 2011-08-05
Posts: 15
Website

is it possible to create a linklist with an id instead of class?

is it possible to create a linklist with an id instead of class? the code i’m trying to get to work looks like this:

<txp:linklist category=“region” wraptag=“ul” break=“li” class=“top_margin” />

i want the class to apply to the first break only (the first <li>) rather then the ul. for the ul i want to apply an id not a class.

the final output should look like this:

<ul id=“sub_buy”>
<li class=“top_margin”><a href=“http://www.alberta.com”>Alberta</a></li>
<li><a href=“http://www.bc.com”>British Columbia</a></li>
<li><a href=“http://www.manitoba.com”>Manitoba</a></li>
<li><a href=“http://saskatchewan.com”>Saskatchewan</a></li>
</ul>

is this at all possible?

Offline

#2 2011-08-09 17:59:27

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

Re: is it possible to create a linklist with an id instead of class?

Something like this?

<ul id="sub_buy">
   <txp:linklist category="region" break="" limit="1">
      <li class="top_margin"><txp:link /></li>
   </txp:linklist>
   <txp:linklist category="region" break="li" offset="1">
      <txp:link />
   </txp:linklist>
</ul>

Unfortunately there is no such tag as <txp:if_first_link>

Offline

#3 2011-08-09 17:59:33

maruchan
Member
From: Ukiah, California
Registered: 2010-06-12
Posts: 596
Website

Re: is it possible to create a linklist with an id instead of class?

For the <li>…what about just using CSS?

#sub_buy li:first-child {margin-top:blah} 

will allow you to add the extra margin.

Offline

#4 2011-08-09 19:06:29

NicChen00
Member
From: Edmonton
Registered: 2011-08-05
Posts: 15
Website

Re: is it possible to create a linklist with an id instead of class?

thanks for both your answers! i went with the css version as it seemed the simpliest. much appreciated.

Offline

Board footer

Powered by FluxBB