Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-10-13 15:18:11

leafy_loader
Member
Registered: 2008-09-25
Posts: 96

Categories for sections

I want to create categories and assign them to particular sections. I don’t seem to be able to do that. Is this posible?

To expand. I want to display a list of linked categories that I have associated to a section. At the moment I can only list all categories and I don’t seem to be able to limit it to a particular section.

Last edited by leafy_loader (2008-10-13 15:32:36)

Offline

#2 2008-10-13 15:31:36

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,538
Website GitHub Twitter

Re: Categories for sections

Hi

section and category are independant from each other.

But you can link to category in particular section (by using txp:category_list with section parameter), a link to a category look like: yoursite.com/section/?c=yourcategory

Cheers

Offline

#3 2008-10-13 15:35:27

leafy_loader
Member
Registered: 2008-09-25
Posts: 96

Re: Categories for sections

Thanks Dragondz, I’m using txp:category_list at the moment but it lists every category I’ve created rather than just the ones I want to display for that section

Offline

#4 2008-10-13 19:20:03

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

Re: Categories for sections

A workaround is to create parent categories with the same name as the sections, and use asy_wondertag:

<txp:asy_wondertag>
<txp:category_list parent="<txp:section />" exclude="<txp:section />" this_section="1" />
</txp:asy_wondertag>

Offline

#5 2008-10-15 20:50:52

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Categories for sections

Or I think you could use an “if_different” form with the article tag something like:-

The Form

<txp:if_different>
<li><txp:category1 title="1" link="1" /></li>
</txp:if_different>

Where you want the list to appear

<ul>
<txp:article form="theFormName" limit="999" />
</ul>

I think that would work. Use your own HTML formatting of course. As the article tag is “context-sensitive” you should only end up with categories that contain articles in the current section.

Last edited by thebombsite (2008-10-15 20:53:40)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

Board footer

Powered by FluxBB