Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-08-15 03:26:14

photonomad
Member
Registered: 2005-09-10
Posts: 290
Website

How to display only articles that DO NOT have a category assigned?

This may seem like a strange request, but is there a way to only display articles with empty categories?

I’m trying to do something like this…

<txp:article_custom status="sticky" section='<txp:section />' category="">

I am just curious if there is an easy way to specify null or empty? putting nothing in between the quotes doesn’t work…

EDIT: I figured it out by using the plugin smd_if : )

<txp:if_article_list>
<txp:article_custom status="sticky" section='<txp:section />' limit="999">
<txp:smd_if field="category1,category2" operator="isempty,isempty">
<div class="article">
<h1><txp:title /></h1>
<txp:body />
</div>
</txp:smd_if>
</txp:article_custom>
</txp:if_article_list>

Thanks Bloke!

Last edited by photonomad (2009-08-15 04:36:24)

Offline

Board footer

Powered by FluxBB