Skip to content

Instantly share code, notes, and snippets.

@gunjanpatel
Created July 11, 2016 05:10
Show Gist options
  • Select an option

  • Save gunjanpatel/0e5a2178ff5a533ed9eeb5d9549d5275 to your computer and use it in GitHub Desktop.

Select an option

Save gunjanpatel/0e5a2178ff5a533ed9eeb5d9549d5275 to your computer and use it in GitHub Desktop.
Get article or content menu item from backend
<?php
// Get site menu - specially pass `site` argument as you are going to get site menu from backend.
$menu = JFactory::getApplication()->getMenu('site');
// Get menu item based on query
$menuItems = $menu->getItems('link', 'index.php?option=com_content&view=article&id=' . (int) $this->item->id);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment