Jump to content

Using if statements


Recommended Posts

I have made another tpl file called banners.tpl. I only want this to come in on the index page. So I want to make an 'if' statement. PHP isn't my thing. Currently I just have it styled out on any page that doesn't have the body id of #index which isn't ideal. And as this uses smarty tags I guess the code would be slightly different to php anyway?

I cannot just add the code to the index file as I want it to appear about the left column not just in the center column.

Any suggestions? Thanks.

Link to comment
Share on other sites

  • 3 months later...

Razaro, is it somehow possible to check, if a category is equal to some category id or name?

I've tryed with

{if $category->id == 2}my banner{/if}



then also with $category_name == '2-music-ipods' and $category_id but with no luck.

If you know, how to do that, please share that with all of us. I need this, because i want different banner for each category.

Thank you,
Housy

Link to comment
Share on other sites

Check this thread to see a solution for categories.

Cheers

Razaro, is it somehow possible to check, if a category is equal to some category id or name?

I've tryed with

{if $category->id == 2}my banner{/if}



then also with $category_name == '2-music-ipods' and $category_id but with no luck.

If you know, how to do that, please share that with all of us. I need this, because i want different banner for each category.

Thank you,
Housy

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...