gingic Posted February 1, 2010 Share Posted February 1, 2010 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 helpRegardsGingic Link to comment Share on other sites More sharing options...
lkkr Posted February 2, 2010 Share Posted February 2, 2010 Ehm.. You could try something with index.php.I should think that's the file what shows the frontpage. Link to comment Share on other sites More sharing options...
gingic Posted February 2, 2010 Author Share Posted February 2, 2010 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 thisif ($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 More sharing options...
lkkr Posted February 2, 2010 Share Posted February 2, 2010 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 More sharing options...
gingic Posted February 2, 2010 Author Share Posted February 2, 2010 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 More sharing options...
lkkr Posted February 2, 2010 Share Posted February 2, 2010 I'm not planning to debug this for you..I gave the basic stuff.. Now it's time for you to go debugging.Echo variables and see for yourself what's wrong and how to fix it. Link to comment Share on other sites More sharing options...
rocky Posted February 3, 2010 Share Posted February 3, 2010 You can use the following code: {if $page_name == 'index'} ... {else} ... {/if} Link to comment Share on other sites More sharing options...
gingic Posted February 3, 2010 Author Share Posted February 3, 2010 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...smartyMany thanks to you 2 guysgingic Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now