Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#13 2006-04-27 21:04:55
- lisionosk
- Member
- From: Switzerland
- Registered: 2006-02-10
- Posts: 99
Re: Random archived page.
Above the first “else” tag is:
<code><txp:if_section name=“tag”>
<txp:tru_tags_handler form=“thumbnail_form” />
</div></code>
It calls for the “tag” page. The random link would point to older entries of the “photolog” section. :)
Offline
#14 2006-04-27 21:17:01
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Random archived page.
I think you can just paste it in the ul, like this:
<code>
…
<li><a href=”/archives/”>view all</a></li>
<li><txp:article_custom section=“photolog” form=“random_form” limit=“1” sortby=“rand()” /></li></ul>
</code>
I just put the article_custom tag at the bottom of my article form and it worked.
Offline
#15 2006-04-27 21:27:51
- lisionosk
- Member
- From: Switzerland
- Registered: 2006-02-10
- Posts: 99
Re: Random archived page.
Pasting this code snippet that way worked to make the link point to a random archive entry, but, unfortunately, it causes the images to not be displayed anymore.
Offline
#16 2006-04-27 21:37:06
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Random archived page.
Ah I see, that’s a pity. I wouldn’t know why this is unfortunately. One thing you could try is giving the form ‘random_form’ type: misc, and call it in your article form with <txp:output_form form="random_form" />
. Don’t ask me why, I remember that doing this once solved a problem for me, but what problem that exactly was I don’t remember…
Edit: it’s also possible that I put the article_custom tag in a misc form and called that one with txp:output_form.
Last edited by els (2006-04-27 21:43:46)
Offline
#17 2006-04-27 21:44:26
- lisionosk
- Member
- From: Switzerland
- Registered: 2006-02-10
- Posts: 99
Re: Random archived page.
And… where would you put <code><txp:article_custom section=“photolog” form=“random_form” limit=“1” sortby=“rand()” /></li></code> in there ? ;)
Sorry to tax you so much. After this, I might just try to tweak some more, and failing that, a ‘Random Link From a List’ script.
Offline
#18 2006-04-27 22:07:16
- lisionosk
- Member
- From: Switzerland
- Registered: 2006-02-10
- Posts: 99
Re: Random archived page.
PANIC.
I was tweaking with the forms, and seeing as it was not working (the photolog page was taking very long to load), I selected the random forms to delete them, and since then have started getting blank pages with the message ‘Fatal error: Call to undefined function: parse() in /home/urbangri/public_html/textpattern/lib/txplib_misc.php on line 1309’ on every page of the TXP web interface!
Please. Help. I swear I will leave the code alone, after this.
Last edited by lisionosk (2006-04-27 22:19:16)
Offline
#19 2006-04-27 22:27:54
- lisionosk
- Member
- From: Switzerland
- Registered: 2006-02-10
- Posts: 99
Re: Random archived page.
Well, I don’t know what happened, but it recovered now. Thanks for your time, Els. I won’t bother you anymore. Enjoy the rest of the evening. :)
Last edited by lisionosk (2006-04-27 22:28:11)
Offline
#20 2006-04-27 22:29:27
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Random archived page.
I didn’t mean to get you into trouble ;) Sorry for that.
Offline
#21 2006-04-27 22:32:19
- lisionosk
- Member
- From: Switzerland
- Registered: 2006-02-10
- Posts: 99
Re: Random archived page.
Sure, it’s ok! You tried to help, and that’s great. :)
Offline