You are here:Home»KB»Web Design»eCommerce»Prestashop»Run code only on the homepage (Smarty if Statement )
Thursday, 04 June 2015 15:26

Run code only on the homepage (Smarty if Statement )

Written by

These should be used in the header.tpl and can be changed to make code run on specific pages.

Run code only on the homepage

1.

{if $page_name == 'index'}
    <div class="home">
{else}
    <div>
{/if}

2.

{if $page_name == 'index'}
<script type="text/javascript">
    var yiw_prettyphoto_style = 'pp_default';
</script>
{else}
{/if}

 

Read 1875 times