Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-11-16 20:06:18

LuciferVandros
Member
Registered: 2005-09-09
Posts: 20

Manual Category List Question

Is it possible to output a list of categories, but specify exactly what categories you want to display? In other words, I want to have an < ul > list of categories in my sidebar that when you click on shows the excerpts from articles that have been assigned to that category. I don’t need help with the latter, I’m just wondering if there is something like < txp:category_list categories=“food, links, news” />?

Thanks.

Offline

#2 2005-11-17 14:01:30

LuciferVandros
Member
Registered: 2005-09-09
Posts: 20

Re: Manual Category List Question

Anyone?

Offline

#3 2005-11-17 15:36:45

reid
Member
From: Atlanta, Ga.
Registered: 2004-04-04
Posts: 224
Website

Re: Manual Category List Question

You can manually add a link like this for each category you want:

<code><a href=”/index.php?c=Art”>Art</a></code>

Last edited by reid (2005-11-17 15:39:20)


TextPattern user since 04/04/04

Offline

#4 2005-11-17 15:50:53

LuciferVandros
Member
Registered: 2005-09-09
Posts: 20

Re: Manual Category List Question

Thanks. I guess specifying a list of categories in the tag is not something that can be accomplished?

Offline

#5 2005-11-17 16:26:34

reid
Member
From: Atlanta, Ga.
Registered: 2004-04-04
Posts: 224
Website

Re: Manual Category List Question

Not exactly in the manner you seem to want, at least not that I know of (and stating it isn’t possilbe is the best way to draw out someone to show you “yes, it is”).

I’ve had to do the same thing with the drop down menu that Txp uses by default to browse categories. I couldn’t get it to output the categories in the manner I wanted, so I manually create it … and store it in a form that I call in the templates. It’s still a pain to have to manually enter a new category in the code when you add one, but at least by placing it in a form, it only needs to be changed in that one place.


TextPattern user since 04/04/04

Offline

#6 2005-11-17 16:34:29

LuciferVandros
Member
Registered: 2005-09-09
Posts: 20

Re: Manual Category List Question

Right. Once I got your first reply I figured a form would be the answer for hardcoded category links. Thanks a lot for your help.

Offline

#7 2005-11-17 16:35:59

rsilletti
Moderator
From: Spokane WA
Registered: 2004-04-28
Posts: 707

Re: Manual Category List Question

<code><txp:category /></code> will output a linked category by name or title.
<a href=“http://textpattern.net/wiki/index.php?title=Txp:category_/”>Txp:category</a>
There is also a conditional <code><txp:if_category></code> that will take a comma delimited list as an attribute, but the gray area in between that you describe will probably require a hard coded list or a plugin.

Offline

#8 2005-11-17 17:48:07

LuciferVandros
Member
Registered: 2005-09-09
Posts: 20

Re: Manual Category List Question

> reid wrote:

> You can manually add a link like this for each category you want:

<code><a href=”/index.php?c=Art”>Art</a></code>

One more question. Will this type of link work with clean urls? That’s what I’m using.

Offline

#9 2005-11-17 18:59:55

reid
Member
From: Atlanta, Ga.
Registered: 2004-04-04
Posts: 224
Website

Re: Manual Category List Question

That link should give you a list of articles in a particular category, regardless of whether you have “clean” or “messy” set in the preferences. The URL for that category page would not be “clean,” it would be something like domain.com/index.php?c=Art

However, all the articles listed on that page would be links with their usual clean URL’s.


TextPattern user since 04/04/04

Offline

#10 2005-11-17 19:27:34

LuciferVandros
Member
Registered: 2005-09-09
Posts: 20

Re: Manual Category List Question

Got it. Thanks!

Offline

#11 2005-11-17 21:45:02

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

Re: Manual Category List Question

domain.com/category/art also works (that’s what <txp:category link="y" /> gives).

Offline

#12 2005-11-17 21:47:43

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: Manual Category List Question


Alex

Offline

Board footer

Powered by FluxBB