1

I am building a module in Joomla. I am using the Module Parameter (Menuitem). It returns the menu id to the default.php file in the module.

I then build a URL with the following code:

$itemID = $params->get( 'url' ); // Menuitem id
$application = JFactory::getApplication();
$menu = $application->getMenu();
$item = $menu->getItem( $itemID );
$link = new JURI($item->link);
$link->setVar( 'ItemId', $itemid );
$articleLink = $link;

It works correctly but the link is not a SEF url:

It is:

index.php/component/content/article?id=25

instead of:

index.php/call-back-request

How would i convert the url to a SEF url? any help would be appeciated

George Wilson
  • 5,595
  • 5
  • 29
  • 42
Sebastian Opperman
  • 241
  • 1
  • 7
  • 18

1 Answers1

2

You can create sef url using JRoute. This may help you-

$link=JRoute::_($link);

for more details read this- http://docs.joomla.org/Search_Engine_Friendly_URLs

Update:

//article sef
$catslug = $row->catid.':'.$row->category_alias;
$slug = $row->id.':'.$row->alias;
$link = JRoute::_(ContentHelperRoute::getArticleRoute($slug, $catslug));
Irfan
  • 7,029
  • 3
  • 42
  • 57