Smarty Conditional

Discussion in 'Templates, HTML, CSS, and Design Help' started by blackorange, Jan 4, 2012.

  1. blackorange Member

    Hi,

    I'm brand new to Smarty... I seem to be understanding it quite well but I'm a bit stuck on this conditional... I just need to say:

    {if home or index}
    ....
    {else}
    ....
    {/if}


    Just need to know how to reference the home or index page (I hope!).

    Thanks
    Tom
  2. Mike-N-Tosh Developer & Moderator

    {if $body == "home.tpl"}...

    they both use the same body page template.
  3. blackorange Member

    arh perfection! Thank you.
  4. seymourjames All Hands On Deck

    You can also use $scriptname . TC provides a way to test for nearly all types of pages. Look in modules/templatecodes/includes/TC_Scriptname.php

Share This Page