Hi, Does anyone know if there is a Smarty conditional for specific categories? I.e. If CATEGORY = THIS_CAT THEN... ELSE... END... Thanks Tom
Use the smarty debug debug console (lots of posts about that on the forum) to find out if a category variable is available to the specific template file where you wish to make a test. You then make a straightforward smarty test on that variable (lots of examples in your template files on how to create smarty tests).
A little rabbit trail from this particular post... Useing an if statement such as the following: Code: {if $categoryname == "My Category"}Cool, this works!{elseif $categoryname == "Your Category"}Nope, doesn't work{else}Nice try{/if} Is there a limit to how many {elseif}'s you can use...basically what I'm wanting to know is can you overtax your server resourses if you use too many or doesn't it really make any difference if you use 1 or say 50 ?
First of all that code will not work on many template files but will work on some. The point is to understand the coding process and the use of the smarty debug console. If not the person learns nothing. Well thousands of test yes but a few dozen no. You would not even see the difference.
Did you use the debug console? If you did then you will see why this is an indispensable tool for modifying your templates.