Jump to content

[SOLVED] How to stop "PrestaCuber" displaying in a every page?


Recommended Posts

Hallo nice people!

My theme included a "prestacuber" slider in it when I installed it. But now I dont know how I can to stop it displaying in a every page except homepage? I tried from admin/modules/positions and Transplant a module/Exceptions files as : (identity.php, history.php, order.php, product.php and breadcrumb.php)... but it dont stop to display in a all pages...

Please, give me some advice :(

Thanks in advance

Link to comment
Share on other sites

I'm not familiar with the module, but you could try adding the following to the top of the TPL file:

{if $page_name == 'index'}



and the following at the end:

{/if}



Hi rocky! Thank you for your reply! I checked out modules tpl but its a empty.. instead there XML files! I added those codes in a empty TPL file and XML files but nothing happened... Is there another way to fix it?

Thanks in advance!
Link to comment
Share on other sites

Hi rocky again! I added this code in a modules PHP as below and tested it in a different places of around the "function hook". But all modules in the admin disappears after this :

if ($page_name == 'index')
{

function hookHome($params)
{
global $smarty;
return $this->display(__FILE__, 'prestacuber.tpl');
}
function hookLeftColumn($params)
{
return $this->hookHome($params);
}

function hookRightColumn($params)
{
return $this->hookHome($params);
}

}
?>}



I also copied the "hook" codes from other Cuber modules which works as normal... but nothing happens yet..:(

What do you think it is?

Link to comment
Share on other sites

You put the code in the wrong place. That module appears to be using the "Homepage content" hook, so it should already only be displayed on the homepage. Did you transplant it to the left or right column? If so use:

function hookHome($params)
{
  global $smarty;
  return $this->display(__FILE__, 'prestacuber.tpl');
}
function hookLeftColumn($params)
{
  if ($page_name == 'index')
     return $this->hookHome($params);
}

function hookRightColumn($params)
{
  if ($page_name == 'index')
     return $this->hookHome($params);
}
}
?>

Link to comment
Share on other sites

Hi rocky. The module transplanted only to Homepage content (originally) but it displays in everywhere and thats a very weird... I tested with this code too, unfortunately still unsuccessful... I think, it must be something with template files that the module is "hardly integrated" on pages. But I dont know where to start looking... On the other hand I like this modules look but it can be irritating for customers or at least I have to change it displaying a different stuff than Homepage, on products pages.

Link to comment
Share on other sites

I've had a look at your site and the problem is that the PrestaCuber isn't installed as a module. It is hardcoded in the theme. You need to edit themes/smoke/header.tpl and change:



to:

{if $page_name == 'index'}


<script language="JavaScript" src="{php}echo __PS_BASE_URI__;{/php}modules/prestacuber/images.php">[removed]



<embed src="{php}echo __PS_BASE_URI__;{/php}modules/prestacuber/cu3er.swf?id={1|rand:20}" width="975" height="319" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" base="{php}echo __PS_BASE_URI__;{/php}modules/prestacuber/" scale="exactfit" wmode="transparent"></embed>

{/if}



<script language="JavaScript" src="{php}echo __PS_BASE_URI__;{/php}modules/prestacuber/images.php">[removed]



<embed src="{php}echo __PS_BASE_URI__;{/php}modules/prestacuber/cu3er.swf?id={1|rand:20}" width="975" height="319" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" base="{php}echo __PS_BASE_URI__;{/php}modules/prestacuber/" scale="exactfit" wmode="transparent"></embed>

Link to comment
Share on other sites

Open header.tpl in your theme folder find this code

<script language="JavaScript" src="{php}echo __PS_BASE_URI__;{/php}modules/prestacuber/images.php"></script>



<embed src="{php}echo __PS_BASE_URI__;{/php}modules/prestacuber/cu3er.swf?id={1|rand:20}" width="975" height="319" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" base="{php}echo __PS_BASE_URI__;{/php}modules/prestacuber/" scale="exactfit" wmode="transparent"></embed>



and like rocky said put if condition around it

{if $page_name == 'index'} 
<script language="JavaScript" src="{php}echo __PS_BASE_URI__;{/php}modules/prestacuber/images.php"></script>



<embed src="{php}echo __PS_BASE_URI__;{/php}modules/prestacuber/cu3er.swf?id={1|rand:20}" width="975" height="319" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" base="{php}echo __PS_BASE_URI__;{/php}modules/prestacuber/" scale="exactfit" wmode="transparent"></embed>


{/if} 



EDIT: was little late and didn't saw your response rocky, you can delete post

Link to comment
Share on other sites

  • 1 year later...
×
×
  • Create New...