Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-02-10 22:34:12

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 689
Website Mastodon

article_custom: entry for <<no category assigned>> ??

Hello everyone,

when i use category assignments with an article_custom tag:

Can i assign a term to describe, that no category has been assigned?

like

<txp:article_custom category=”<no category assigned>” />

maybe even on a cat1 or cat2 base?

Both category=”“ or category=“default” only lead to errors here.

Thank you for any hints!

Last edited by jayrope (2010-02-10 22:35:59)


A hole turned upside down is a dome, when there’s also gravity.

Offline

#2 2010-02-10 22:54:39

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: article_custom: entry for <<no category assigned>> ??

A workaround:

<txp:article_custom>
   <txp:if_article_category>
      // content here
   </txp:if_article_category>
</txp:article_custom>

Don’t know if it will slow things down if you have many articles though.

Last edited by els (2010-02-10 22:55:09)

Offline

#3 2010-02-10 23:24:04

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 689
Website Mastodon

Re: article_custom: entry for <<no category assigned>> ??

Interesting workaround.
How would i go with this, when there’s both assigned and non-assigned categories to be treated and how could i make a disticntion between set or unset cat1 and cat2?

Thank you for any hint in advance!


A hole turned upside down is a dome, when there’s also gravity.

Offline

#4 2010-02-11 00:00:34

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: article_custom: entry for <<no category assigned>> ??

You can select by cat1 and 2 like this:

<txp:if_article_category number="1">: if category1 has a (any) value (if_article_category)

But what I actually meant to say in my previous post (I posted too hastily) is this:

<txp:article_custom>
   <txp:if_article_category>
      // article has a category assigned
   <txp:else />
      // no category assigned
   </txp:if_article_category>
</txp:article_custom>

and you can use the number attribute to check for just category 1 or 2.

Offline

Board footer

Powered by FluxBB