Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Buttonsrow link won't open new window

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 12-13-2006, 12:07 PM
 
Sisom Sisom is offline
 

eXpert
  
Join Date: Sep 2006
Posts: 310
 

Default Buttonsrow link won't open new window

Hi everybody, I've been adding new links using my standard buttons that are used throughout my site, and although they work fine for anchors within pages, I can't get them to open a new window for a new page, from a static page.

The code I'm using is
<p class="ButtonsRow">{include file="buttons/button.tpl" button_title=$lng.lbl_open_new_window href="https://www.mywebsite.com/home.php" target="_blank" style="button"}</p>

In this case, the target="_blank" isn't working. It doesn't appear in the source code when I checked the HTML on the page itself, so something's not quite right here. Can anybody help?

The source HTML code that the above produces looks like this, if it's any help:
<p class="ButtonsRow">
<table cellspacing="0" cellpadding="0" onclick="javascript: self.location='https://www.mywebsite.com/home.php';" class="ButtonTable">
<tr><td><img src="/skin1/images/custom/but1.gif" class="ButtonSide" alt="" /></td><td class="Button"><font class="Button">Open new window</font></td><td>
<img src="/skin1/images/custom/but2.gif" class="ButtonSide" alt="" /></td></tr>
</table>
</p>
__________________
X-Cart Gold Version 4.3.2
Reply With Quote
  #2  
Old 12-14-2006, 07:20 AM
 
Sisom Sisom is offline
 

eXpert
  
Join Date: Sep 2006
Posts: 310
 

Default Re: Buttonsrow link won't open new window

I should add that this code is being used on a static page, and I've ticked the box to parse Smarty tags.
__________________
X-Cart Gold Version 4.3.2
Reply With Quote
  #3  
Old 12-18-2006, 06:55 AM
 
Sisom Sisom is offline
 

eXpert
  
Join Date: Sep 2006
Posts: 310
 

Default Re: Buttonsrow link won't open new window

I contacted Qualiteam and the answer is as follows:
<p class="ButtonsRow">{include file="buttons/button.tpl" button_title=$lng.lbl_open_new_window href="javascript: window.open('https://www.mysite.com/home.php');" target="_blank" style="button"}</p>

i.e. change
href="https://www.mywebsite.com/home.php" target="_blank"
to
href="javascript: window.open('https://www.mysite.com/home.php'); target="_blank"


Just thought I'd post up the answer in case anybody else ever had/has this problem.
__________________
X-Cart Gold Version 4.3.2
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 01:43 AM.

   

 
X-Cart forums © 2001-2020