Jump to content

1 header for Home Page, Different header for the rest


Recommended Posts

I want a flash animation to appear as the header for the home page, but the rest of the versions to show a static version.

I thought I could use a PHP include but realised I cant as they are TPL files, has anyone got any ideas?

Thanks

Link to comment
Share on other sites

OK see below how I solved for those who want to know how to do this

Inserting PHP into a tpl file:

{php}
include('header_flash.php');
{/php}



The code to display a different flash header on index.php (this is the file header_flash.php):

<?php
if(basename($_SERVER['PHP_SELF'])=='index.php')
{
include 'flash_anim.php';
}
else
{
include 'flash_static.php';
}
?>

Link to comment
Share on other sites

This is another way of doing it.

Go to header.php in the root. Look for the last two lines:



$smarty->display(_PS_THEME_DIR_.'header.tpl');

?>



Change it to


if ($page_name == 'index')
$smarty->display(_PS_THEME_DIR_.'header-something.tpl');
else
$smarty->display(_PS_THEME_DIR_.'header.tpl');

?>



Then just prepare a header-something.tpl and upload it to the themes folder. That is it.

Link to comment
Share on other sites

This is another way of doing it.

Go to header.php in the root. Look for the last two lines:



$smarty->display(_PS_THEME_DIR_.'header.tpl');

?>



Change it to


if ($page_name == 'index')
$smarty->display(_PS_THEME_DIR_.'header-something.tpl');
else
$smarty->display(_PS_THEME_DIR_.'header.tpl');

?>



Then just prepare a header-something.tpl and upload it to the themes folder. That is it.



Thank you Star. I did what you said and it works.
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...