Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-03-03 00:36:50

jshan
Member
Registered: 2008-01-09
Posts: 67

How to list all categories EXCEPT one?

Hi,

Because of the site design, as illustrated below:

<txp:article_custom category="has_image" limit="9" sort=random() />

I’m using the category has_image for “housekeeping”/admin purpose only. Now I’m seeking an easy way to display all categories EXCEPT has_image.

I just got rss_unlimited_categories plugin installed. Maybe something like a combination of <txp:rss_unlimited_categories_filedunder /> and <txp:category_list />… Does anyone have any suggestions?

Thanks!

Last edited by jshan (2009-03-03 00:43:57)

Offline

#2 2009-03-03 03:19:25

JanDW
Plugin Author
From: Providence, RI, USA
Registered: 2008-07-18
Posts: 327
Website

Re: How to list all categories EXCEPT one?

<txp:category_list /> has an exclude attribute: so is <txp:category_list exclude="has_image" /> what you’re after?


TXPDream – A Textpattern Tag Library for Adobe Dreamweaver. (updated for 4.2.0) | jdw_if_ajax – Only serve certain parts of a page when requested with AJAX

Offline

#3 2009-03-03 05:17:04

jshan
Member
Registered: 2008-01-09
Posts: 67

Re: How to list all categories EXCEPT one?

Okay… maybe I was not clear on this.

<txp:category_list /> outputs the list of ALL categories universally (with the option of exclusion of your choice). What I want is on the display of each individual article, list all the categories that particular article is filed under. Because of rss_unlimited_category plugin, I’ll have an article with the following categories assigned, for instance, “has_image”, “hardware”, “tool”, “DIY”.

As mentioned, “has_image” is only for site construction/admin purpose. So I’d only want to show something like this:

Filed under: hardware, tool; DIY

Before I implemented unlimited categories, I just used <txp:category2 /> since I had set “has_image” as category1. That simply did all the job since each article could only have 2 categories before.

Offline

Board footer

Powered by FluxBB