Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Making a box link open into a new window / session?


Desolas

Recommended Posts

Posted

I am trying to make some of the links on my side menu open into a new window. My PHP skills are not very good, so I'm probably just having an issue with figuring out the right syntax without getting an error. I've tried searching the forum and googling this, but I'm not coming up with what I need.

 

For example, I've add a box with menu items that will open into different pages, much like the default setup where the information.php box opens the shipping.php, etc. But I want some of them to open off site links.

 

Say I've got something like this in mysamplebox.php ..

 

$info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_TRACK_INFO) . '">' . BOX_TRACK_INFO . '</a><br>' .

 

Now instead of it opening the file I've defined as TRACK_INFO I would rather it open a URL like "http://www.url.com/forum.php" to open a message forum.

 

What's the proper way to change that link above to make it open in a new window? I've figured out if I make a php file with a refresh to the URL of my choice I can make it open that file, and it will redirect into the right location BUT it does it in the same window the user is in .. I need it in a new window since it is taking the user from the main site.

 

Thank you for your help.

Posted
I am trying to make some of the links on my side menu open into a new window. My PHP skills are not very good, so I'm probably just having an issue with figuring out the right syntax without getting an error. I've tried searching the forum and googling this, but I'm not coming up with what I need.

 

For example, I've add a box with menu items that will open into different pages, much like the default setup where the information.php box opens the shipping.php, etc. But I want some of them to open off site links.

 

Say I've got something like this in mysamplebox.php ..

 

$info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_TRACK_INFO) . '">' . BOX_TRACK_INFO . '</a><br>' .

 

Now instead of it opening the file I've defined as TRACK_INFO I would rather it open a URL like "http://www.url.com/forum.php" to open a message forum.

 

What's the proper way to change that link above to make it open in a new window? I've figured out if I make a php file with a refresh to the URL of my choice I can make it open that file, and it will redirect into the right location BUT it does it in the same window the user is in .. I need it in a new window since it is taking the user from the main site.

 

Thank you for your help.

 

try this

 

$info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_TRACK_INFO) . '" target = "new">' . BOX_TRACK_INFO . '</a><br>' .

 

or

 

 

$info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_TRACK_INFO) . '" target = "blank">' . BOX_TRACK_INFO . '</a><br>' .

Hard Work Is The Simplest Way Of Success

Posted
try this

 

$info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_TRACK_INFO) . '" target = "new">' . BOX_TRACK_INFO . '</a><br>' .

 

or

$info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_TRACK_INFO) . '" target = "blank">' . BOX_TRACK_INFO . '</a><br>' .

 

as far as I'm aware the current convention is target=_blank : target=_parent : target=_self or target=_top

 

new and/or blank without the underscore in OSC might be a different fix though....

for a new window I'd use _blank

 

good luck

 

Digs.

one-click installation..

Dave's info

Posted

Exactly what I needed, thank you both.

 

It required an underscore, so _blank it was. . I was just putting it on the wrong side of the link for some reason, works just like I needed it to.

 

Thank you!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...