I developed a module to display submenus as stand alone module, every thing works fine untill the sef is enabled, the item id does not change to the correct one
<ul class="list2">
<?php foreach ($items as $row) :?>
<?php
//$router = JSite::getRouter();
if ($router->getMode() == JROUTER_MODE_SEF) {
$link = $router->build($row->link);
$router->setVar('Itemid',$row->id);
echo $_REQUEST['Itemid'];
//$link =$row->alias;
}else {
$link = $row->link.'&Itemid='.$row->id;
}
?>
I tried using the JSITE::route even router->build and tried to reset $_Request[‘Itemid’]
and nothing worked
what I do wrong, any help please ?
found the solution, just need to change the item id before creating the link
hopfully this will help other developers 🙂