Only two files need to be modified for this on Joomla 1.5.15:
- administer/components/com_menus/models/metadeta/url.xml
- modules/mod_mainmenu/legacy.php
First add this to the url.xml file, under the first "menu_image" parameter:
Code: Select all
<param name="popuptype" type="list" default="popup1" label="Popup Window Type" description="Popup Window Type">
<option value="popup1">Lightbox Popup - Ajax</option>
<option value="popup2">Regular Popup</option>
</param>
<param name="popupwidth" type="text" default="600" label="Popup Width" description="Popup Window Width"></param>
<param name="popupheight" type="text" default="600" label="Popup Height" description="Popup Window Height"></param>
Code: Select all
$mitem->name = stripslashes(htmlspecialchars($mitem->name));
Code: Select all
$popupmethod = $menu_params->def('popuptype');
$popupmethodwidth = $menu_params->def('popupwidth');
$popupmethodheight = $menu_params->def('popupheight');
Code: Select all
if ($popupmethod == 'popup1')
{
$txt = "<a href=\"" . $mitem->url . "\" rel=\"width[" . $popupmethodwidth . "];height[" . $popupmethodheight . "];\" class=\"$menuclass jcepopup\" " . $id . ">" . $mitem->name . "</a>\n";
break;
}
if ($popupmethod == 'popup2') {
$txt = "<a href=\"#\" onclick=\"javascript: window.open('" . $mitem->url . "', '', 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=" . $popupmethodwidth . ",height=" . $popupmethodheight . "'); return false\" class=\"$menuclass\" " . $id . ">" . $mitem->name . "</a>\n";
break;
}
Also the syntax for the lightbox width and height above is for JCE popup, and usually is the same for all lightbox scripts, but it might need to be changed if a different syntax is used by your script.
IMPORTANT NOTE: The "On Click, Open in:" option under the external menu link "Menu Item Details" options needs to be set to "New Window Without Browser Navigation" for it to work also.