Start a conversation

How to show HTML code only on home page

If you want to add some code to one of your templates (ex: customer/home.tpl) and want this code to be show only on home page, you can use this statement:


{if $main eq "catalog" and $current_category.category eq ""}

<!-- this code will be shown only on home page -->

{/if}


or if you need to use 2 variations for home page and other pages:


{if $main eq "catalog" and $current_category.category eq ""}

<!-- this code will be shown only on home page -->

{else}

<!-- this code will be shown on other pages -->

{/if}


Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Anton Pachkine

  2. Posted
  3. Updated

Comments