Jump to content

[SOLVED] Adding module to 1 page only.


Recommended Posts

The only other way is use Smarty to hide the module code on every page but the one you want. For example, to show a module only on the homepage, add the following to the top of the module's TPL file:

{if $page_name == 'index'}



and the following to the bottom:

{/if}

Link to comment
Share on other sites

  • 5 months later...

Hi Rocky,

I am wondering how I would go about using the above code in my modules tpl file if I just want to have it appear on one particular CMS page.

ie. cms.php?id_cms=4

So if I just want the block I am using (in my case the advertising block) to show up on that page only, what would the code I would use be?

Thanks for your help!

Link to comment
Share on other sites

  • 1 year later...

Thanks rocky!

 

i've been searching for days. I thought it had something to do with hooks.

 

finally i got to display side adv banner only in category page

 

{if $smarty.get.id_category == 7}
<!-- MODULE Block advertising7 -->
<div class="advertising_block">
<a href="{$adv_link}" title="{$adv_title}"><img src="{$image}" alt="{$adv_title}" title="{$adv_title}" width="202"  height="500" /></a>
</div>
<!-- /MODULE Block advertising7 -->
<!-- /title="{$adv_title}" width="155"  height="163" /></a> -->
{/if}

 

Still, i prefer to place the banner at the centre instead of right side, just below the HOME>MY CATEGORY, and only in my category page. Can anybody help me with that?

 

i know that theres an option at BO to insert image for category, but it just display image, can't insert link.

 

tried this http://nemops.com/a-deeper-look-at-prestashop-hooks/ but didn't work :mellow:

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