Jump to content

Image Mapping(scenes) on homepage


Recommended Posts

Hello everyone,

I'm trying to get Image Mapping (scenes) show on homepage.

I've found this solution in the forum, but cant get it running in



class IndexController extends IndexControllerCore
public function __construct()

public function setMedia() {
  if ($this->context->getMobileDevice() == false)
   //TODO : check why cluetip css is include without js file
    _THEME_CSS_DIR_.'scenes.css' => 'all',
    _THEME_CSS_DIR_.'category.css' => 'all',
    _THEME_CSS_DIR_.'product_list.css' => 'all',
   if (Configuration::get('PS_COMPARATOR_MAX_ITEM') > 0)

public function process()
  * Assign scenes template vars

protected function assignScenes()
  // Scenes (could be externalised to another controler if you need them)
  $scenes = Scene::getScenes($this->category->id, $this->context->language->id, true, false);
  $this->context->smarty->assign('scenes', $scenes);

  // Scenes images formats
  if ($scenes && ($sceneImageTypes = ImageType::getImagesTypes('scenes')))
   foreach ($sceneImageTypes as $sceneImageType)
    if ($sceneImageType['name'] == ImageType::getFormatedName('m_scene'))
	 $thumbSceneImageType = $sceneImageType;
    elseif ($sceneImageType['name'] == ImageType::getFormatedName('scene'))
    $largeSceneImageType = $sceneImageType;

	 'thumbSceneImageType' => isset($thumbSceneImageType) ? $thumbSceneImageType : null,
	 'largeSceneImageType' => isset($largeSceneImageType) ? $largeSceneImageType : null,


In your index.tpl:

{if $scenes}
<!-- Scenes -->
{include file="$tpl_dir./scenes.tpl" scenes=$scenes}

I dont have any idea why its not working. Will appriciate very much any help

Thank you very much :)

All the best,

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