Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Force selected category
Hi,
How easy is it to force a category to be selected? If I was writing this with PHP I’d do something along the lines of:
if (!isset ($category))
{
$category = “Introduction”;
}
I’d also like to be able to display a full article if ‘Introduction’ is the selected category or a list of article links, though I haven’t decided exactly how they will be displayed, probably thumbnails with title, photo, date
I’m using the rdt_dynamenus plugin and sections to navigate through the site – more info here http://forum.textpattern.com/viewtopic.php?id=11575
thanks!
Jon
Last edited by jben.net (2005-10-26 16:10:47)
Offline
Re: Force selected category
You could use the <code><txp:if_category name=“CategoryName”><txp:else /></txp:if_category></code> in a page template to swap the output provided that the category is a part of the page URL.
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
Re: Force selected category
hi,
Cool thanks I’ll try that. I also managed to do the exact same thing using some PHP at the top of the template, what if any are the cons of using php directly over txp tags?
Ta,
Jon
Offline
Re: Force selected category
would I be able to force a particular category to be selected if no category has been selected by the user ??
Your suggestion answers my second question perfectly though.
Thanks,
Jon
Offline
Pages: 1