Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Exclude a category from txp:article
Or txp:custom_article for that matter. I’ve been trying a few different ways to simply output a sidebar with short articles in a “quick links” category. The best technique seems to be txp:article_custom category=“quick-links”, etc. But now I’m just puzzling how to exclude these articles from the home page main article listing. This is quite trivial (if unaesthetic) to do in Wordpress so I thought it’d be a doddle with Textpattern — particularly given how hard it is to output multiple ‘loops’ on the one page with Wordpress. But there doesn’t seem to be any exclusion facility in the default tags.
I guess some kind of conditional might do the trick? I’m not keen on a plugin, as I’m using a fair number already. What am I missing?
Offline
#2 2008-04-05 08:12:32
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Exclude a category from txp:article
You could assign the ‘quick links’ articles to a section of their own, and set that section to not be displayed on the front page. Use <txp:article_custom />
to call them in the sidebar.
Alternatively, you could use a conditional in your article form for the front page articles:
<txp:if_article_category name="quick-links">
<!-- do nothing -->
<txp:else />
here the content of your article form
</txp:if_article_category>
Offline
Re: Exclude a category from txp:article
Ah, that might do the trick. Thanks.
Anyone know if exclusions are on the horizon? They’re pretty handy to have.
Offline
Re: Exclude a category from txp:article
Instead if excluding, you could only include the categories you want. Although I agree that an exclude tag would come in handy
Offline
Offline
Re: Exclude a category from txp:article
I agree, and thats why an exclude=“comma seperated list” would come in handy ;)
Offline
Re: Exclude a category from txp:article
This is where an where
attribute comes in handy, where you can add something to the where part of the SQL query, otherwise we’d get exclude_section, exclude_category, exclude_author, exclude_id, exclude_something_else and the list of attributes explodes.
Offline
#8 2008-04-06 03:23:16
- Logoleptic
- Plugin Author
- From: Kansas, USA
- Registered: 2004-02-29
- Posts: 482
Re: Exclude a category from txp:article
There may be a plugin that offers selective category exclusion. I could swear I’ve seen such a thing on Textpattern Resources.
Offline
Re: Exclude a category from txp:article
I had a skim through the Category category on Textpattern resources but didn’t come up with anything. I do find sometimes that new plugins aren’t always immediately categorised correctly there, though.
Offline
Pages: 1