Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2009-03-12 18:21:26
- ploinkr
- Member
- From: Montreal
- Registered: 2007-12-06
- Posts: 83
Selective list with different words as styled, linked list items
Hi there,
I’m a bit of a newbie here, so I hope I can explain clearly what I’m trying to do.
I’m working on a new site for an art gallery where, on a specific page for the current exhibition, I want to have a list of predefined, related articles.
- presentation
- texts
- clues
- media
in that specific order and with the item representing the current page having a specific class (.selected).
I’ve tried making the list using categories and custom fields (which I’m more or less able to do) but I can’t figure out how to output the list of words (presentation, etc.) as links to the specific related article.
Not sure if that’s clear enough but I’ll take anything anyone can throw at me ;-)
Thanks in advance,
Ben
Last edited by ploinkr (2009-03-12 18:30:41)
Offline
#2 2009-03-12 21:18:39
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Selective list with different words as styled, linked list items
What is/are the tag(s) you use to generate the list? I must admit I don’t quite understand this:
I’ve tried making the list using categories and custom fields
Could you explain how you did that? Otherwise it’s hard to answer your question.
Offline
Re: Selective list with different words as styled, linked list items
i am sentence unable a structure to.
spam reported
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
#4 2009-03-18 15:15:13
- ploinkr
- Member
- From: Montreal
- Registered: 2007-12-06
- Posts: 83
Re: Selective list with different words as styled, linked list items
Els wrote:
Could you explain how you did that? Otherwise it’s hard to answer your question.
Els, sorry it took me so long to reply. What I did is just create a form with an unordered list, with each <li>
targeting a specific article (at least, that’s what I’m trying to do!)
Here’s what it could look like:
<ul>
<li <txp:if_blablabla>class="selected"</txp:if_blablabla>><a href="<txp:link-to-specific-article />">
presentation </a></li>
<li..... etc.
</ul>
Is that even possible to do? With plugins maybe? (asy_wondertag? chh_article?)
Thanks,
B.
Offline
#5 2009-03-19 03:00:57
- ploinkr
- Member
- From: Montreal
- Registered: 2007-12-06
- Posts: 83
Re: Selective list with different words as styled, linked list items
Whew! Just found a way to do it.
Here’s the code I used:
<ul class="materiel">
<li class="extra <txp:if_custom_field clues="main">selected</txp:if_custom_field>"><txp:asy_wondertag><txp:article_custom clues="main" LastName="<txp:custom_field name="LastName"/>" form="permlink_presentation" /></txp:asy_wondertag></li>
<li class="extra <txp:if_custom_field clues="texts">selected</txp:if_custom_field>"><txp:asy_wondertag><txp:article_custom clues="texts" LastName="<txp:custom_field name="LastName"/>" form="permlink_texts" /></txp:asy_wondertag></li>
<li class="extra <txp:if_custom_field clues="clues">selected</txp:if_custom_field>"><txp:asy_wondertag><txp:article_custom clues="clues" LastName="<txp:custom_field name="LastName"/>" form="permlink_clues" /></txp:asy_wondertag></li>
<li class="extra <txp:if_custom_field clues="media">selected</txp:if_custom_field>"><txp:asy_wondertag><txp:article_custom clues="media" LastName="<txp:custom_field name="LastName"/>" form="permlink_capsules" /></txp:asy_wondertag></li>
</ul>
Each permlink
form contains something like <txp:permlink>présentation</txp:permlink>
I’m sure it’s not the cleanest way to do it (feel free to post suggestions!) but for now I’m just happy I got it to work… ‘:-P
Edit: Errrr… Yeah…. the “selected” class thing’s not working. Gotta find the right hook.
Last edited by ploinkr (2009-03-19 17:09:02)
Offline