Jump to content

[v1.6.1.5] [SOLVED] Edit block banner module to open link in a new tab


Recommended Posts

Hi guys, someone can help me with a little thing? This is a marginal modification i want to make on my site, but if it works, would be a nice addition. Basically, i want to modify the block banner module in order to open the link associated to the banner image in a new tab instead of the current one.

I thought to add somewhere, like in blockbanner.tpl, a sort of ..target="blank"... but to be honest i don't know where...

Thanks in advance!

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

Assuming you're using the default PrestaShop v1.6.1.5 theme, copy modules/blockbanner/blockbanner.tpl to themes/default-bootstrap/modules/blockbanner/blockbanner.tpl, then you can change line 25 from:

<a href="{if $banner_link}{$banner_link|escape:'htmlall':'UTF-8'}{else}{if isset($force_ssl) && $force_ssl}{$base_dir_ssl}{else}{$base_dir}{/if}{/if}" title="{$banner_desc|escape:'htmlall':'UTF-8'}">

to:

<a href="{if $banner_link}{$banner_link|escape:'htmlall':'UTF-8'}{else}{if isset($force_ssl) && $force_ssl}{$base_dir_ssl}{else}{$base_dir}{/if}{/if}" title="{$banner_desc|escape:'htmlall':'UTF-8'}" target="_blank">
  • Like 1
Link to comment
Share on other sites

Perfect, it works correctly, thank you  :) In the folder .../themes/default-bootstrap/modules/ there wasn't the blockbanner folder, i made that and looks like it's working with no issues so far.

Thanks again!

Link to comment
Share on other sites

  • 4 months later...

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