View Full Version : {if $category.ID != 0} - few questions
Jim_Westergren
10-31-2005, 11:19 PM
I am using {if $category.ID != 0} and {if $category.ID == 0} a lot but have some questions.
If I want something to show on only one specific category how do I know which number it is?
And also is somthing like this possible:
{if $category.ID == 0-10} ?
And can I know how far the number goes to?
Thanks!
Hi Jim,
You can see the category numbers in the Admin area. If you go to Directory then Categories u can see the category number when u put your mouse on the name of the Category in the first column. Not sure if there's anywhere else u can see it. I'm sure someone will tell us if there is.
Not sure about the 0-10 part.
:)
Jim_Westergren
11-01-2005, 12:14 AM
Thanks.
This can be very valuable when selling special link slots on a certain category page or reciprocal links.
WebDesignPoint
11-01-2005, 06:38 PM
Content visible to registered users only.
No, that's not possible. PHP will interpret that as 0 minus 10. You would need to use an array like:
Content visible to registered users only.
But I'm not sure if Smarty works like that.
Jim_Westergren
11-01-2005, 07:06 PM
Thanks. It's worth a try.
Otherwise maybe this works:
{if $category.ID == 1}
HTML
{else}
{if $category.ID == 2}
HTML
{else}
{if $category.ID == 3}
HTML
{else}
{if $category.ID == 4}
HTML
{/if}
etc.
I will check it out a bit later.
phil2564
11-01-2005, 08:52 PM
I do this same thing on my site I display different content on different pages and I do it with a simple if statment I get the ID numbers from the database it self open mysql with phpmyadmin in order to find the coresponding numbers for your categories you need.
Content visible to registered users only.
Hope this Helps you out.
Phil
Need more help email me at {email address removed}
phil2564
11-01-2005, 08:55 PM
No ELSE is needed for this to work.
vBulletin® v3.8.0, Copyright ©2000-2012, Jelsoft Enterprises Ltd.