Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-05-11 06:01:20

scdoody
Member
Registered: 2006-10-18
Posts: 129

Issue with if_category

Does anyone know why this if_category tag is not working. Even though I am trying to filter out the articles tagged with the ‘Inspire’ category, they are still showing up in my recent articles list.

Here is my code:

<txp:if_category name=“Inspire”>&nbsp;
<txp:else />

<txp:recent_articles label=”“ limit=“5” break=“li” wraptag=“ul” />

</txp:if_category>

Offline

#2 2007-05-11 06:37:52

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: Issue with if_category

Looks like you have nothing in there to display before the else tag:

<txp:if_category name=“Inspire”>
Do something here……
<txp:else />

<txp:recent_articles label=”“ limit=“5” break=“li” wraptag=“ul” />

</txp:if_category>

Offline

#3 2007-05-11 06:43:28

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: Issue with if_category

if_category tests if the current article list is one for the category mentioned (i.e., if the current page’s URL is http://www.example.com/category/Inspire or http://www.example.com/?c=Inspire). It does not test every single article’s categories and include them depending on the result of this check.

You will have to build a solution around article_custom.

Last edited by wet (2007-05-11 06:44:07)

Offline

Board footer

Powered by FluxBB