Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-08-04 23:09:56

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

Random Link (resolved)

I did a search but a lot of the topics on this were old. I want to use the Link tab in TXP to store, links. In the place it gets used, I need to limit=“1”, and set it to random, as well set the category. The current TXP tag for links do not do this, right? I couldn’t find a plugin that does it either. I know I could use a custom field and article_custom, but I want to keep the articles section of my site clean. the link section isn’t be used so I figure why not?

Last edited by mrtunes (2009-08-12 18:42:33)

Offline

#2 2009-08-04 23:20:23

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

Re: Random Link (resolved)

Like this?

<txp:linklist category="yourcat" limit="1" sort="rand()">
   <txp:link />
</txp:linklist>

Offline

#3 2009-08-04 23:28:27

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

Re: Random Link (resolved)

fantastic! now i just need to replace <txp:link /> with a plugin that will strip away all the html, because i just want the plain URL outputted.

EDIT: looks like <txp:link_url /> should do the trick

Last edited by mrtunes (2009-08-04 23:29:43)

Offline

#4 2009-08-12 18:42:22

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

Re: Random Link (resolved)

just wanted to follow up and thank you for helping so fast. everything is working fine. cheers

Offline

Board footer

Powered by FluxBB