50cent Posted May 25, 2011 Share Posted May 25, 2011 Hi,I'm still constantly puzzled with this OOPHP and SMARTY! It's really frustrating considering I have a pretty decent knowledge of standard PHP!Anyway, could somebody tell me the syntax/code for this simple conditional?I need to know how to write in SMARTY "if this page = index.php" or "if this page = product.php" etc..So I can display certain things on certain pages.I know it is simple but I can't work it out :-S Thanks Link to comment Share on other sites More sharing options...
YopixelAE Posted May 25, 2011 Share Posted May 25, 2011 Hi, for exemple, no left column displayed on homepage: {if $page_name != 'index'} {$HOOK_LEFT_COLUMN} {/if} Another exemple, right column only displayed on product page: {if $page_name == 'product'} {$HOOK_RIGHT_COLUMN} {/if} Link to comment Share on other sites More sharing options...
50cent Posted May 26, 2011 Author Share Posted May 26, 2011 Many thanks for your reply. I also have another problem I'm trying to solve here: http://www.prestashop.com/forums/viewthread/111241/integration/display_product_condition_field_on_product_page_v1_dot_450cent Link to comment Share on other sites More sharing options...
spidermax Posted June 28, 2011 Share Posted June 28, 2011 i have also used this to remove left hook works fine but i have more need from it, it removes left hook on home page but i want it to remove it from cms pages aswell.i tried {if $page_name != 'index or cms'} {$HOOK_LEFT_COLUMN} {/if} but that does not seem to work. Link to comment Share on other sites More sharing options...
50cent Posted June 28, 2011 Author Share Posted June 28, 2011 try {if $page_name != ‘index` && $page_name != `cms’} {$HOOK_LEFT_COLUMN} {/if} Link to comment Share on other sites More sharing options...
spidermax Posted June 28, 2011 Share Posted June 28, 2011 nah it displays all the time with that Link to comment Share on other sites More sharing options...
50cent Posted June 28, 2011 Author Share Posted June 28, 2011 double check the actual page name returned by $page_name on cms pages by echoing the $page_name variable somewhere on the page i.e. add {$page_name} somewhere Link to comment Share on other sites More sharing options...
spidermax Posted June 28, 2011 Share Posted June 28, 2011 yeah its called cms, when i used {if $page_name != ‘index` && $page_name != `cms’} it showed the left hook on the home page again that it didnt beforei have also tried {if $page_name != ‘index` OR $page_name != `cms’} that dosnt work either Link to comment Share on other sites More sharing options...
Hermeswein Posted October 23, 2011 Share Posted October 23, 2011 Many thx, Félix-v1.4 ! Link to comment Share on other sites More sharing options...
TVBZ Posted July 7, 2020 Share Posted July 7, 2020 This is an old post. But I had a simular problem in PS 1.7.6.5. And since the info here didn't work for me, I'll post what worked for me: {if $page.page_name != 'index'} ... {/if} Basicly, the only thing that changed is $page_name is now replaced by $page.page_name. 1 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