Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2006-10-18 01:44:36
- deronsizemore
- Member
- From: Kentucky
- Registered: 2005-11-02
- Posts: 324
Random advertisements
I was reading <a href=“http://forum.textpattern.com/viewtopic.php?id=19164”>THIS THREAD</a> about random testimonials and it got me thinking.
Eventually I’m hoping to get interest in advertising on my site, could I use the same code for displaying random advertisement links on a site? Just make new articles with nothing but linked images? I assume it will work, but thought I would ask.
<txp:article_custom form="testimonials" limit="3" section="ads" sort="rand()" />
Offline
#2 2006-10-18 03:27:56
- mercury
- Member
- Registered: 2006-05-12
- Posts: 26
Re: Random advertisements
Offline
Re: Random advertisements
You could do that but you could also use a linklist. Either way works, but the linklist route is pretty simple.
- Content>Organize
- Create a link category: “ads”
- Content>Links
- Post a link with the image in either the title or description
- If you post the image as the title, you’ll need to use HTML (I don’t think it’s Textiled)
- If you post the image as a description, you can use Textile (!img) – Adv Prefs>Textile Link Description
- Post a link with the image in either the title or description
- Post the URL
- Page Template:
<txp:linklist category="ads" form="ads" limit="1" sort="rand()" />
- Form Template:
<a href="<txp:link_url />" rel="external"><txp:link_description /></a>
– replace description with title, if you prefer.
Offline
#4 2006-10-18 12:46:20
- deronsizemore
- Member
- From: Kentucky
- Registered: 2005-11-02
- Posts: 324
Re: Random advertisements
Thanks Jon. Seems easy enough either way. I need to bookmark this thread, cause I know I’ll forget that by the time I’m actually needing to set up something like this (if I ever do). :-)
Offline
Pages: 1