Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-10-08 17:10:17

brunodario
Member
From: Belo Horizonte, Brasil
Registered: 2007-09-19
Posts: 75

<txp:category_list section="Thisonly"/> returns ALL categories :-/

Hi there,

I´m using the following tag

<txp:category_list section=“Section1” break=“li” wraptag=“ul” />

to list the categories assigned only to a specified section, but the output ignores the rule “section” and display all categories!

Any clues if i´m missing something?

Thx

Offline

#2 2007-10-08 17:19:16

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: <txp:category_list section="Thisonly"/> returns ALL categories :-/

Textbook says:

section=“section name” Link to categories within the specified section. Default is unset, resulting in links without section restriction.

Which means that the links created by category_list are in the form /section?c=your_category instead of /?c=your_category. What you want, that tag cannot do.

Offline

#3 2007-10-08 17:21:22

brunodario
Member
From: Belo Horizonte, Brasil
Registered: 2007-09-19
Posts: 75

Re: <txp:category_list section="Thisonly"/> returns ALL categories :-/

Allright… so, is there a way to do this?

Offline

#4 2007-10-08 17:28:05

obeewan
Archived Plugin Author
From: Stockholm, Sweden
Registered: 2004-08-12
Posts: 319
Website

Re: <txp:category_list section="Thisonly"/> returns ALL categories :-/

… to list the categories assigned only to a specified section …

Is this even possible? Sure, you can name a parent category the same name as a section but not “lock it” to usage only for articles in that section, or?

Sorry for no answers but more questions :)


Plugins: ob1_advanced_search 1.032b, ob1_search_score 1.0, ob1_pagination 2.5, ob1_title 4.1, ob1_modified 2.1

“Let your plans be dark and as impenetratable as night, and when you move, fall like a thunderbolt.”
— Sun Tzu

Offline

#5 2007-10-08 18:09:35

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: <txp:category_list section="Thisonly"/> returns ALL categories :-/

Offline

#6 2007-10-11 20:42:18

EddieG5
Member
From: Georgia
Registered: 2004-03-03
Posts: 96

Re: <txp:category_list section="Thisonly"/> returns ALL categories :-/

This plugin is returning the categories for me in a list, but when I click on a particular category, how do I get a page returned that shows those articles associated with that category? Right now, when I click on the category, it returns the same page I’m one with all articles listed, not just the ones in that category.

Offline

#7 2007-10-11 22:00:27

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

Re: <txp:category_list section="Thisonly"/> returns ALL categories :-/

Could you use:-

<ul><txp:article_custom section="sectionName" form="catList" limit="999" /></ul>

where the form “catList” is something like:-

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

or something similar?

Last edited by thebombsite (2007-10-11 22:00:47)


Stuart

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

Offline

#8 2007-10-11 22:06:53

EddieG5
Member
From: Georgia
Registered: 2004-03-03
Posts: 96

Re: <txp:category_list section="Thisonly"/> returns ALL categories :-/

I just tried this … do I need to change “sectionName” to something else for the article categories to show up?

Basically, I’ve got a series of article categories … when I write an article, I’ll also tag it with one of these category names. I’d like to have a side bar that lists the different categories that have articles associated with them and if I click on one of them, it will go to that category.

Offline

#9 2007-10-13 10:08:22

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

Re: <txp:category_list section="Thisonly"/> returns ALL categories :-/

The code I show would produce a list of categories for a specific section which is the one specified in “sectionName” however if you don’t want it to be from a specified section then just remove that attribute. On the other hand, if you wanted a list of categories specific to the section you are currently viewing you could use the <txp:article /> tag instead of <txp:article_custom /> which should make it context-sensitive. You could also add the “sort” attribute to sort the list the way you want it.

Last edited by thebombsite (2007-10-13 10:14:50)


Stuart

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

Offline

Board footer

Powered by FluxBB