Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-05-06 18:21:55

Krigsoffer
Member
From: DK
Registered: 2005-12-08
Posts: 13

Category-sections to follow the "archive" template!

Is it possible to make the category-sections follow the “archive” page template?

If so, then how i might ask?

Offline

#2 2006-05-06 19:12:02

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: Category-sections to follow the "archive" template!


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#3 2006-05-07 11:06:07

Krigsoffer
Member
From: DK
Registered: 2005-12-08
Posts: 13

Re: Category-sections to follow the "archive" template!

Yes, i think so. But i can’t get figure out how to use it!

Following Thebombsite’s instructions, seems to be a little harder than i thought. And through that, i realized that i suck at coding…

So, my stupid question would now be: Is this the way to make the category-archives dependant on the “archive”-template?

The idea is that my front page, only has one article posted at a time1.
So when visitors enter the various category-links, they will see all existing articles, from the corresponding category2.

1 “default”-template: < txp:article limit=1 />

2 “archive”-template: < txp:article limit=[insanely high number, representing infinity] />

Get it?
… Hope you do, because i’m a sad man right now…

Offline

#4 2006-05-07 11:46:21

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Category-sections to follow the "archive" template!

Yes, that should be right. Because the <txp:article /> tag is context sensitive, it will only show articles in the category that is requested. Be sure to code the links to the category pages the way Stuart explained in his post, so if you want a link to the article’s category page in your article form this would be: <a href="<txp:site_url /><txp:section />/?c=<txp:category1 />"><txp:category1 title=1 /></a>, and a navigation menu would become something like this:
<code>
<ul><li><a href=”<txp:site_url /><txp:section name=“name-of-section” />/?c=<txp:category name=“name-of-your-first-category” /><txp:category name=“name-of-your-first-category” title=“1” /></a></li>
<li><a href=”<txp:site_url /><txp:section name=“name-of-section” />/?c=<txp:category name=“name-of-your-second-category” /><txp:category name=“name-of-your-second-category” title=“1” /></a></li>
<li><a href=”<txp:site_url /><txp:section name=“name-of-section” />/?c=<txp:category name=“name-of-your-third-category” /><txp:category name=“name-of-your-third-category” title=“1” /></a></li>
etcetera…
</ul>
</code>
You could of course also do this
<a href="http://yoursite.com/name-of-section/?c=name-of-your-category">Title-of-your-category</a>
but if you ever changed a category or section name or title you’d have to change all of the links to it as well.

Offline

Board footer

Powered by FluxBB