/ Published in: PHP
Joomla SEF to work properly it is based on Joomla menus. In your own components for SEF to work and menus to appear your need to pass the Itemid to links. To do this you need to get the Itemid based on on the URL link. Here is how you get the Itemid by link.
This code gets the Itemid of a menu link when you know the component and the view
This code gets the Itemid of a menu link when you know the component and the view
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$url = 'index.php?option=[[option]]&view=[[view]]'; $menu = &JSite::getMenu(); $menuItem = $menu->getItems( 'link', $url, true ); $Itemid = $menuItem->id;