Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2007-05-16 18:51:43
- ondass
- New Member
- Registered: 2007-05-02
- Posts: 3
Single link from a category in a post
Hello,
how to create a post that would display a single link from a category containing already more than one link. I investigated the txp:linklist, but it allows only the whole category to be displayed (or some several first links).
So how do a reference only a single link from a category, either by its name or ID?
many thanks.
Ondra.
Offline
Re: Single link from a category in a post
Don’t laugh, but this might work, although it’s not exactly the most efficient way to do it (123 = the ID of the link you want to display):
<txp:linklist sort="ABS(id - 123) ASC" limit="1" />
This would work, because only if ‘id’ is equal to ‘123’, ABS(id - 123)
is zero. In all other cases it’s a positive number, so when sorting in ascending order, it’s the first in the list.
Last edited by ruud (2007-05-16 19:41:44)
Offline
Re: Single link from a category in a post
Less clever, but also worth a try: wet_linkinfo.
Offline
#4 2007-05-17 11:59:15
- ondass
- New Member
- Registered: 2007-05-02
- Posts: 3
Re: Single link from a category in a post
Many thanks to both of you.
O.
Offline
Pages: 1