Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-02-12 12:16:50

pieman
Member
From: Bristol, UK
Registered: 2005-09-22
Posts: 491
Website

call an article which has no category set

Seems like a simple one, but it’s got me.

I want to call a sticky article within a section, but I only want to retrieve an article which doesn’t have any categories set.

Something akin to <txp:article_custom section="that-section" category="null/no-way/nothing-to-see-here" status="sticky" />

thanks in advance

Stu

Offline

#2 2008-02-12 13:06:35

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: call an article which has no category set

Try inside your article form:

<txp:if_article_category>
	<txp:else />
	<!--
		Here is my article tags for article that has no category set
	-->
</txp:if_article_category>

And pull that article form + article with your article_custom ;)

Last edited by Gocom (2008-02-12 13:07:08)

Offline

#3 2008-02-13 15:08:53

pieman
Member
From: Bristol, UK
Registered: 2005-09-22
Posts: 491
Website

Re: call an article which has no category set

Thanks Jukka, but it’s not quite doing what I want.

I’m trying to get 4 articles. This solution is only showing 2 bits of content.

I think maybe it’s returning both full and empty outputs – in this case it’s come across 2 articles in the first 4 which do have a category, so it’s just sending a blank article back in each case.

Offline

Board footer

Powered by FluxBB