Posted: Wed Dec 15, 2004 11:00 am Post subject: working with the category template
John,
I have an include file that shows up on my category pages, but I don't want the file to show up when I add a new category that does not yet have any articles placed in it. Do you know of a code that I could use to make this possible? Like; if category has articles then include file, but if category does not have articles then dont include file. Something along those lines. Any ideas? Thanks.
Posted: Thu Dec 16, 2004 12:58 am Post subject: Re: working with the category template
You could try code like this:
Code:
{{if days}}
there are articles in this category
{{else}}
there are no articles in this category
{{/if}}
In a category without articles, the days variable will be empty so there are no articles in this category will be displayed. Replace that with your own stuff and you should be set.
Depending on what you are trying to do, you could just do this:
Code:
{{if days}}
there are articles in this category
{{/if}}
or this
Code:
{{unless days}}
there are no articles in this category
{{/unless}}
Make sure you put this code outside the days loop...
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum