I have added a link to my menu using MyPortal. The problem is that I don't want it to open in a frame I want it to open in a new window. Can anyone tell me how this can be done?
I have added a link to my menu using MyPortal. The problem is that I don't want it to open in a frame I want it to open in a new window. Can anyone tell me how this can be done?
This seems like it should be so simple, but I have been stuck on it for a while. I've tried searching the forums, but I can't find anything that works or makes much sense to me. Has anyone run into this problem, there must be a solution!
It doesn't seem that you can do this without a corehack in the module IFrames... but I would modify first the theme and add by hand the tab with your link than touch anything in the module IFrames...
You can modify the header in themes/<ThemeName>/header.php and also themes/<ThemeName>/header.html
I have modify the theme Sugar adding a param TARGET that I take in header.html where the menu is located.
In my case is in the line 574 where starts the code
And in header.html I added a the property target here:PHP Code:foreach ($moreListHeader as $module_name) {
if (!is_array($module_name)) {
if($module_name!=$currentModule and $_SESSION['moreTab']!=$module_name){
$xtpl->assign("MODULE_NAME", $app_list_strings['moduleList'][$module_name]);
$xtpl->assign("MODULE_KEY", $module_name);
$xtpl->assign("TARGET", "");
$xtpl->assign("TAB_URL", "index.php?module=$module_name&action=index");
$xtpl->parse("main.more");
}
} else {
if (!isset($_REQUEST['record']) or $_REQUEST['record']!=$module_name[0]) {
$xtpl->assign("MODULE_NAME", $module_name[4]);
$xtpl->assign("MODULE_KEY", $module_name[3]);
$xtpl->assign("TARGET", "_blank"); //This is the new line I added with the target
$xtpl->assign("TAB_URL", "{$module_name[1]}");//This line I changed it so it takes only the url of the website I want, it has to have the http://
$xtpl->assign("MODULE_QUERY", '&record='.$module_name[0].'&tab='.$module_name[2]);
$xtpl->parse("main.more");
}
}
}
It starts in line 150 because My link is in the "MoreMenu", but if the tab is going to be in other place then you will have to find the correct place to put the target.
Like this it opens for me the link in a target=_blankPHP Code:<div id="MoreMenu" class="menu" onMouseOver="window.clearTimeout(SUGAR.themes.resetSubTabsTimer);" onMouseOut="SUGAR.themes.setResetTimer();">
<!-- BEGIN: more -->
<a href="{TAB_URL}" class="menuItem" id="{MODULE_KEY}Handle" parentid="MoreMenu"
target="{TARGET}" //added property target
onMouseOver="hiliteItem(this,'yes');SUGAR.themes.updateSubTabsDelay(SUGAR.themes.moreTab,'{{MODULE_NAME|htmlspecialchars}','{MODULE_NAME|htmlspecialchars}');closeSubMenus(this);" onMouseOut="unhiliteItem(this);" onClick="SUGAR.themes.chooseTab('{MODULE_NAME}'); return true;">{MODULE_NAME}</a>
<!-- END: more -->
</div>
But this example works for ALL links you add with MyPortal... you can add ifs to check if it is the one you want in _blank target... and of course this is not upgrade safe...
Hope this can help
Elisabeth Escribano
Webdeveloper
MADCAP verademing in ict
e.escribano@madcap.nl
Schapedrift 89
3371 JJ Hardinxveld-Giessendam
Netherlands
Tel 088 99 088 99
Fax 088 99 088 98
www.madcap.nl
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks