PDA

View Full Version : open all links in new window?


gunneradt
07-11-08, 00:43
can someone tell me how to make all links in V2 open in a new window?

many thanks

gunneradt
07-11-08, 10:02
Ive got all of the links opening in a new window by amending the config.inc file except the one entitled 'more info' on the individual product pages

if someone could point me to that id be grateful

Amoochi
07-11-08, 14:52
I'd love to help you with some nice quick method for this, but besides suggesting that you do what I do, which is to go through every individual template and set the target for links individually within each template to open in a new page that way, I don't know of any other method, personally.

Ollie
07-11-08, 15:57
Hi Gunner

If you go into your templates directory there will be a file called 'config.inc'.

In there you will find:
PopUpWindow = "no"
If you change this to "yes" you should have pop-up windows enabled.

One thing to note, there is a slight error in the client which will be fixed in the next release.

If you navigate to /templates/default/elements/product_display.tpl and goto line 28-30 you should have:
{if #PopUpWindow#=='yes'}
<a href="#" onclick="window.open('{$oProduct->sBuyLink}', '', '{#PopUpSettings#}')">{#currencySign#}{$oProduct->fPrice|number_format:2}</a> <a href="{$oProduct->sBuyLink}"><img src="{$templatePath}images/buy_button.gif" title="More Information" alt="More Information" /></a>
{else}

This should actually be:
{if #PopUpWindow#=='yes'}
<a href="#" onclick="window.open('{$oProduct->sBuyLink}', '', '{#PopUpSettings#}')">{#currencySign#}{$oProduct->fPrice|number_format:2}</a> <a href="#" onclick="window.open('{$oProduct->sBuyLink}', '', '{#PopUpSettings#}')"><img src="{$templatePath}images/buy_button.gif" title="More Information" alt="More Information" /></a>
{else}

To explain whats going on there, the 'More Info' button is using a link to open in the current window. Therefore you must change it so that it actually uses the new window code!

As i said, this will be fixed in the next release.

Cheers :cool:

gunneradt
07-11-08, 17:10
thats brilliant

id edited the config inc but got stuck as to why it wasn't working whjen I edited the product display tpl

now I know why

many thanks