View Full Version : Bug in Templates / menu.php
wrongsector
02-02-2008, 04:48 PM
On some of Site Ground’s templates (for example: the Night Waves template / siteground60) index.php recalls menu.php to put links on top portion or the site (from the mainmenu), and the links on the left side are part of the main menu site module. There seems to be a bug in menu.php where if you have an external link to another website on the top menu links, Mambo will go to the link and add this at the end &Itemid=## (where ## is the id number). Does anyone know how to fix this problem?
-WrongSector
I have included the line from menu.php where I think the bug is:
echo "<li><a href='$row->link&Itemid=$row->id' ".( $row->id == $item_id ? "class='current'" : "" )." ><span>$row->name</span></a></li>";
I was not able to recreate your issue. The external links from the Top menu on a Mambo installation with the Night Waves template are functioning properly on our end.
If the problem persists, please post a ticket through your Help Desk so that we can investigate the issue carefully and, if necessary, pass it to our template designers so that they can resolve it.
Hristo.P
05-19-2009, 04:16 AM
Hello,
I have managed to re-create and solve the issue in both Siteground60 and Siteground62 templates.
The new template versions have been uploaded. You can download and re-install them in order to have this problem fixed.
If you have modified the template signifficantly and you do not want to re-install it, you can open the menu.php file and make the following changes in it:
Change:
$qry = "SELECT id, name, link FROM #__menu WHERE menutype='mainmenu' and parent='0' AND access<='$gid' AND sublevel='0' AND published='1' ORDER BY ordering";
To:
$qry = "SELECT id, name, link, type FROM #__menu WHERE menutype='mainmenu' and parent='0' AND access<='$gid' AND sublevel='0' AND published='1' ORDER BY ordering";
Change:
echo "<li><a href='$row->link&Itemid=$row->id' ".( $row->id == $item_id ? "class='current'" : "" )." ><span>$row->name</span></a></li>";
To:
if ($row->type == 'url')
{echo "<li><a href='$row->link' ".( $row->id == $item_id ? "class='current'" : "" )." ><span>$row->name</span></a></li>";}
else
{echo "<li><a href='$row->link&Itemid=$row->id' ".( $row->id == $item_id ? "class='current'" : "" )." ><span>$row->name</span></a></li>";}
That should do the trick and your menu will work just fine :)