Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
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
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
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