Desolas Posted September 5, 2006 Posted September 5, 2006 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.
GulSar Ray's Posted September 5, 2006 Posted September 5, 2006 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
digbydo Posted September 5, 2006 Posted September 5, 2006 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
Desolas Posted September 6, 2006 Author Posted September 6, 2006 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!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.