I have a problem with joomla 1.5 friendly url (that not so friendly actually) I am not using SEF at the moment (should i ?)
heres is my problem
I have some categories and sections. Each has alias.
so i can check all news category for example by visiting www.myxyz.com/news/
to check an article the url that generated would become: www.myxyz.com/news/10-local-news-title-alias
I have no idea how joomla generate that url. In my templates i need to generate some links to specific articles.
so I create a helper in template:
// helper to get alias in mainMenu ... alias must be unique
function getMainMenu($menuAlias){
$items = &JSite::getMenu();
// Get Menu Items
$rows = $items->getItems('alias', $menuAlias);
if($rows){
//$result = JRoute::_(JURI::base().$rows[0]->link);
$result= JURI::base().substr(JRoute::_($rows[0]->link), strlen(JURI::base(true)) + 1);
return $result;
}else{
return JURI::base() ;// aka not found
}
}
but when I enter the page like www.myabc.com/news/7-local-news-alias the url would become messed up and changed to wrong url.
should I use SEF for joomla url friendly ?