Jump to content
nick2010

[SOLVED] Adding module to 1 page only.

Recommended Posts

Hi,

Is it possible to display a module in the sidebar of 1 page only, without having to add every page but one to the module Exceptions list ?

Share this post


Link to post
Share on other sites

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}

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

Use the following at the top of modules/blockadvertising/blockadvertising.tpl:

{if $smarty.get.id_cms == 4}



and the following at the bottom:

{/if}

Share this post


Link to post
Share on other sites

hello sir,
can u plz help me..as i m new to prestashop and need help in modify some modules for my website...
i have read your posts and thought that u can help me...
i need it for my school project...plz help

Share this post


Link to post
Share on other sites

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:

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More