Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2006-06-27 18:02:24
- Rednax
- New Member
- Registered: 2006-06-27
- Posts: 2
Can this be done?
I’m pretty sure what I want to do is fairly simple, but after a few hours of playing with textpattern I’m not getting it quite right.
I’m writing basic information pages, each being an article. I want the index page to be a static intro text with the latest articles written listed as individual links (I’ve got the latest links working so far).
I want a list of categories links too on the page, among other things I can add. The problem is, right now the index page is showing the latest article (<txp:article limit="1" />) only, and each category link goes to a page showing the latest article in that category (since both are using the default template I assume…)
I want the category pages to simply list all articles in that category, as links (not the whole story, going for SEO here). Then, when the article link is clicked, another page is opened displaying just that article.
Where do I start? Any suggestions? Perhaps I need to make the category pages pull from a template other than default? Can this be done?
Thanks very much,
Rednax
(added @‘s to show the tag. -Els)
Last edited by els (2006-06-27 20:49:21)
Offline
#2 2006-06-27 21:04:07
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Can this be done?
Something like this should do it.
Give your static intro article status ‘sticky’. On the page template for section ‘default’:
<code>
<txp:if_category></code> (if we’re on a category page)
<code><txp:article form=“single” listform=“list” limit=“999” />
<txp:else /></code> (if we’re on the home page)
<code><txp:article status=“sticky” form=“single” limit=“1” />
<txp:article form=“single” listform=“list” limit=“10” />
</txp:if_category>
</code>
The article form “single” (it exists in the default install, but you can modify it) will be used to display the full individual article. Article form “list” (you’ll have to create this one) should contain something like
<code><txp:permlink><txp:title /></txp:permlink>
</code>
For the category links use txp:category_list.
Offline
#3 2006-06-28 16:16:15
- Rednax
- New Member
- Registered: 2006-06-27
- Posts: 2
Re: Can this be done?
Ah thank you very much Els, works like a charm.
Is there any way I can add excerpts to the list as article descriptions?
Article 1
Description here
Article 2
Description here
etc? I tried the excerpt tag after that if_category statement, but it hasn’t been working..
Thanks again
Offline
#4 2006-06-28 17:00:13
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Can this be done?
Change the article form (‘single’) to something like this:
<code>
<txp:if_article_list>
<txp:permlink><txp:title /></txp:permlink>
<txp:excerpt />
<txp:permlink>read more</txp:permlink>
</txp:else />
<txp:title />
<txp:body />
</txp:if_article_list>
</code>
There is also another way to do this, see the FAQ.
Offline
Pages: 1