Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#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

#2 2007-05-16 19:40:45

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

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

#3 2007-05-16 20:03:46

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

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

Board footer

Powered by FluxBB