Objective

How to get Itemid (menu link ID) of a specific Joomla article.

Function

/**
* Gets Itemid of specific article
*/
public function getArticleItemid($articleId)
{
$link = 'index.php?option=com_content&view=article&id='.(int)$articleId;
$menu = JSite::getMenu();
$menuItem = $menu->getItems('link', $link, true);
$Itemid = $menuItem->id;

return $Itemid;
}

Source:

 

Keep Me Informed

Keep me informed of the latest extensions releases and offers. One email maximum per month.

Offer Me A Coffee!

If you like my work, offer me a coffee! Nick.