Jump to content

[SOLVED] How to make the frontpage look different than product pages?


Recommended Posts

Hello guys...

I formerly worked on other cms Drupal and Wordpress. Both of them can support the creation of a unique design of the frontpage, apart of the inner pages.

I need for instance on the frontpage to have no sidebars but to have in the inner pages.

Is it possible?

Please I need help

Regards
Gingic

Link to comment
Share on other sites

Hi, indeed if you are talking about the main index.php...not the one in the theme folder, one could add an index.html which will load first.

The only problem is I need to have the same functionality: cart, featured products displayed in a different layout..that is all which cannot be used unless I work in the theme file.

I need some pcs of code to add in de theme file index.php like this


if ($is_frontpage) {
then add this code
}
else
{
normal pages stuff here
}



Any hints? Or at least to know it can't be possible

Link to comment
Share on other sites

include(dirname(__FILE__).'/config/config.inc.php');

if(intval(Configuration::get('PS_REWRITING_SETTINGS')) === 1)
   $rewrited_url = __PS_BASE_URI__;

if ($_SERVER['PHP_SELF'] != "/" && $_SERVER['PHP_SELF'] != "/index.php") {
   include(dirname(__FILE__).'/header.php');

   $smarty->assign('HOOK_HOME', Module::hookExec('home'));
   $smarty->display(_PS_THEME_DIR_.'index.tpl');

   include(dirname(__FILE__).'/footer.php');
}
else {
   include(dirname(__FILE__).'/header_front.php');
   $smarty->assign('HOOK_HOME', Module::hookExec('home'));
   $smarty->display(_PS_THEME_DIR_.'index_front.tpl');
   include(dirname(__FILE__).'/footer_front.php');
}



Example.. Not tested..

Link to comment
Share on other sites

Hello thanks for the efforts.

I did test it but it seems it never enters the 'else' loop.
First I don't clearly understand when actually the system will read the 'else' branch.

Second 'if' and 'else' they do pretty much the same except in the 'else' we have different header and footer..

If you can clear this out for me would be great.


Muc appreciated your efforts.

Gingic Goran

Link to comment
Share on other sites

Hello

@lkkr I thank you a lot for your help. This is all I wanted to say. Your code is ok ( I did used debug variable ) but its lack is that is not template side. It works in the root index.php only I guess... this is inconvenient...maybe I am wrong.

@rocky Many thanks this is the variable I was longing for... :). It is template side...smarty

Many thanks to you 2 guys

gingic

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...