Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2007-08-29 19:55:44
- snthr
- Member
- Registered: 2007-07-13
- Posts: 42
randomisation query
hi…
i’m using textpattern at the moment to create a photography site, and i want to include a random image on the front page.
the content is organised into projects, with each project containing a group of between ten and thirty images, approximately.
the projects are single articles, so the site structure goes site.com/section/article.
the site is not a photoblog, so it can’t be organised with each photo as a different article.
i want the frontpage to simply have a single image selected at random from all the images in all the projects in the site (if possible), and, ideally, to be able to have a bit of contextual text to go along with it.
what’s the best way of getting this to work? is there any plugin that does something along these lines? will it involve (gulp) messing around with php?
any help welcome; thanks.
Offline
#2 2007-08-29 21:06:15
- marios
- Archived Plugin Author
- Registered: 2005-03-12
- Posts: 1,253
Re: randomisation query
In case, that you have one project image on each article as article_image assigned, you can do this:
On your Site Front Page Template:
<txp:article_custom form=“front_image” sort=“rand()” limit=“1” />
Your custom_article form:
<div id=“rand_img”><txp:article_image thumbnail=“1” /></div>
<div id=“caption”><txp:excerpt /></div>
regards
Last edited by marios (2007-08-29 21:12:44)
⌃ ⇧ < ⎋ ⌃ ⇧ >
Offline
#3 2007-08-30 19:02:41
- snthr
- Member
- Registered: 2007-07-13
- Posts: 42
Re: randomisation query
i’m mucking around with that at the moment and i think it’s done the trick; thanks very much.
Offline
#4 2007-08-31 07:26:11
- panik
- Member
- From: Bonn, Germany
- Registered: 2005-08-13
- Posts: 13
Re: randomisation query
Offline
Pages: 1