Jump to content

[Solved] $page_name == index not consistent?


Recommended Posts


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



Edited by Haegendoorn (see edit history)
Link to comment
Share on other sites

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 by matzmu (see edit history)
Link to comment
Share on other sites



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?


Edited by Haegendoorn (see edit history)
Link to comment
Share on other sites

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

  • 3 weeks later...
  • 3 weeks later...

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

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