Haegendoorn Posted December 11, 2013 Share Posted December 11, 2013 (edited) Hi, I have just launched my new webshop, www.pashmina-boutique.be, using ps1.5.6. I used a theme with a custom module for a slider on the homepage. After testing online, i removed this custom module because the pictures were way to heavy. (The homepage was over 7mb) I wrote some code (and added it at the end of blocktopmenu.tpl), with several compressed images. I want this slider only to display on the homepage, so I added the {if $page_name == 'index'} statement around my code. This seems to work fine, displaying on the homepage, not on content or product pages. But for some reason it does appear on the order page (www.pashmina-boutique.be/order) How can $page_name be index on both the homepage and the order page? Any clues are helpful... Alex Edited January 2, 2014 by Haegendoorn (see edit history) Link to comment Share on other sites More sharing options...
matzmu Posted December 11, 2013 Share Posted December 11, 2013 (edited) First of all. 1. Why images are sliceds ? you prevent images from steel?? ( it makes many http request and better make one big image than 20 smaller ) 2. try to use this if staatment in module like if('index' == $this->context->controller->php_self){ } other solution: when you add your module to hook in admin you can choose , where it should display Edited December 11, 2013 by matzmu (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted December 11, 2013 Share Posted December 11, 2013 hello can you show also outpot of {$page_name} variable? just use it somewhere in header and please check what you will see on order page Link to comment Share on other sites More sharing options...
Haegendoorn Posted December 11, 2013 Author Share Posted December 11, 2013 (edited) hello can you show also outpot of {$page_name} variable? just use it somewhere in header and please check what you will see on order page The output is 'index' on both the order and the homepage. #Matzmu: 1. my attempt to slice the images successfully reduced the size of the homepage from 7mb to below 2mb, without any quality loss (visible) 2. this doesn't seem to work. Any other thoughts? thanks Edited December 11, 2013 by Haegendoorn (see edit history) Link to comment Share on other sites More sharing options...
matzmu Posted December 12, 2013 Share Posted December 12, 2013 edit module and use hookHome Link to comment Share on other sites More sharing options...
Haegendoorn Posted December 13, 2013 Author Share Posted December 13, 2013 Unfortunately the mod hooks (originaly) to top of pages… In the mean timeI have killed the slider on other pages witj JS. I have found the if statement of page-name to be true on order, login,404, contact.(not on content or product pages). Is this specific to my install of PS? Link to comment Share on other sites More sharing options...
Haegendoorn Posted January 2, 2014 Author Share Posted January 2, 2014 The problem seemed to be in the caching of the blocktopmenu. When I created a second module, the $page_name variable worked perfectly. Difficult error to spot, glad I found it! Link to comment Share on other sites More sharing options...
anmihe Posted January 18, 2014 Share Posted January 18, 2014 Hi, having similar issues. ...although trying to use if $page_name inside blocktopmenu.tpl ...but it's not concictent so doesn't work. And assuming it is some caching error. How did you solve this and what do you mean whick created a second module? 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