BlogHarbor Home Page
FAQFAQ  SearchSearch  MemberlistMemberlist  UsergroupsUsergroups  UsergroupsRSS   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
working with the category template
 
Post new topic   Reply to topic    BlogHarbor Community Forum Index -> Tips and Tricks
View previous topic :: View next topic  
Author Message
cr
Guest





PostPosted: Wed Dec 15, 2004 11:00 am    Post subject: working with the category template Reply with quote

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.
Back to top
john
Site Admin


Joined: 16 Mar 2004
Posts: 3434

PostPosted: Thu Dec 16, 2004 12:58 am    Post subject: Re: working with the category template Reply with quote

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...
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Guest






PostPosted: Sat Dec 18, 2004 7:45 am    Post subject: Reply with quote

Thanks John, that worked perfectly! You have been a great help for me. Thanks for everything! Very Happy
Back to top
Search all BlogHarbor support resources.
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    BlogHarbor Community Forum Index -> Tips and Tricks All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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