joomla SEF shows differrent links in Homepage than inner pages !
I'm enabling Joomla SEF , and get the following results when I link to an article from a homepage (frontpage) article:
anywebsite.com/component/content/article/26/141-Z1-Z2-Z3-Z4
but when linking from other articles I get the result I want which is :
anywebsite.com/Categor/141-Z1-Z开发者_如何转开发2-Z3-Z4
and the link is both equal which is :
index.php?option=com_content&view=article&id=141:Z1-Z2-Z3-Z4&catid=26 any idea?!
Edit: Does manually linking with this SEF link is a good idea , instead of waiting for joomla to convert it .. ? atleast as a last resort?
The first SEF URL is the default Joomla SEF format when there aren't any Itemid's (aka menu items) associated with the content. What you use to "link to an article from the hompage" is not providing the Itemid that Joomla needs to build the /Category/141... URL.
I would suggest that, if you want complete control, to use another SEF management component like AceSEF or sh404SEF, which tend to provide more control for URL management.
If you want the controller part removed, you could just get the default menu item and push it's id into the query from your router.
In your router:
if (!isset($query['Itemid']) {
$app =& JFactory::getApplication();
$menu =& $app->getMenu();
$item =& $menu->getActive();
// Do a check to see if $item is set to something. If no active item, get the default:
if (!$item) $item =& $menu->getDefault();
$query['Itemid'] = $item->id;
}
精彩评论