Joomla

Buy me a beer or a book?

amazon PayPal - The safer, easier way to donate online!

JApplication getItemId() in Joomla 1.6

As most of you are aware Joomla 1.6 has been released as stable since January, however, as with all newly released products the documentation isn't quite upto scratch. Especially when it comes to some parts of functionality which have disspaeared from Joomla 1.5 and been replaced with something different in Joomla 1.6.

Previously when you wanted to get an itemid for a certain url or for an article when creating a link using JRoute::_() you would use the following code to get the itemid of whatever component item you were after:

 

Joomla 1.5 getItemId
1
$itemid = JApplication::getItemid($articleId);

 

After a bit of hunting through the Joomla 1.6 lightly documented new framework and core I found that the new way of getting the url using the correct itemId is as follows:

 

Joomla 1.6 getItemId
1
$url = ContentHelperRoute::getArticleRoute($articleId.':'.$articleAlias, $categoryId);

 

I hope this will work it's way into the Google results for these particular parts till the development team of Joomla 1.6 get a chance to document this change.

Free Downloads