Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2006-07-06 09:33:40
- stef25
- Member
- Registered: 2005-12-26
- Posts: 88
show content on homepage
After lots of very long days, I am still having problems setting up my page templates. My categories are “usa” and “Canada”, my sections are “sports” and “news”.
The default page has conditional tags to show content based on category: if_category “usa”, then show usa content. If _category “canada” then show Canada content.
But since everything is wrapped in conditional tags, no content shows on the homepage. I would like to put “show last 5 article excerpts from all cats and sects” on the homepage, but then that code block will also sneek into my category specific pages where it doesn’t belong
I know about the “show on homepage” feature, but what txp tags are used to display that content?
I’m very confused about this basic feature of txp but I think I am making it more complex then it really is. Can anyone offer some advise?
I need someone to protect me from all the measures they take in order to protect me
Offline
#2 2006-07-06 09:37:15
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: show content on homepage
Do:
<txp:if_category><txp:else /><txp:article /></txp:if_category>
:)
Offline
#3 2006-07-06 09:57:23
- stef25
- Member
- Registered: 2005-12-26
- Posts: 88
Re: show content on homepage
so you can use article tags with the name attribute?
I need someone to protect me from all the measures they take in order to protect me
Offline
#4 2006-07-06 11:50:57
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: show content on homepage
Uh… what?
Offline
#5 2006-07-06 11:59:22
- stef25
- Member
- Registered: 2005-12-26
- Posts: 88
Re: show content on homepage
sorry, i think my brain blew a fuse :-)
I meant: so you can use conditional category tags without the name attribute?
Looking at your line of code, my homepage-only code blocks would go where you put txp:article, in the “else” part. It would show up only on the homepage because the homepage is not a category
Correct?
Last edited by stef25 (2006-07-06 12:00:00)
I need someone to protect me from all the measures they take in order to protect me
Offline
#6 2006-07-07 15:39:41
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: show content on homepage
That’s correct. :)
Offline
Pages: 1