Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2012-09-04 04:50:13

husainhk
Member
From: Dubai, UAE
Registered: 2007-08-12
Posts: 105
Website

Show a message when no articles exist on category landing page

Hi,

I am using rss_unlimited_categories to file articles and display them on a category page. I don’t know how to show a custom message, for example, “No articles filed under this category”, when someone lands on a category page with no articles.

I’d really appreciate it, if someone could me.

Cheers,
Husain

Last edited by husainhk (2012-09-04 06:28:15)

Offline

#2 2012-09-04 06:07:46

makss
Plugin Author
From: Ukraine
Registered: 2008-10-21
Posts: 355

Re: Show a message when no articles exist on category landing page

See plugin chh_if_data


aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_dragdrop : Drag&Drop categories (article, link, image, file)

Offline

#3 2012-09-04 06:11:17

husainhk
Member
From: Dubai, UAE
Registered: 2007-08-12
Posts: 105
Website

Re: Show a message when no articles exist on category landing page

Thanks makss!

Do you have the plugin .TXT file handy? My ISP is blocking the download page for some reason, could be the URL.

EDIT: Managed to download the file and works like magic … Thanks so much!

Last edited by husainhk (2012-09-04 06:22:53)

Offline

#4 2012-09-04 06:42:23

etc
Developer
Registered: 2010-11-11
Posts: 5,397
Website GitHub

Re: Show a message when no articles exist on category landing page

Pluginless solution: wrap your articles in a variable (mind the linebreaks).

<txp:variable name="articles"><txp:article_custom ... >
...
</txp:article_custom></txp:variable>

<txp:if_variable name="articles" value="">
  No articles here
<txp:else />
  <txp:variable name="articles" />
  <txp:variable name="articles" value="" />
</txp:variable>

Offline

Board footer

Powered by FluxBB