Skip to content

Instantly share code, notes, and snippets.

@qwersk
Created June 18, 2017 10:56
Show Gist options
  • Select an option

  • Save qwersk/94f400c237955de0294cf35c68a6bb7e to your computer and use it in GitHub Desktop.

Select an option

Save qwersk/94f400c237955de0294cf35c68a6bb7e to your computer and use it in GitHub Desktop.
GET CATEGORY ID #JOOMLA
$app = Jfactory::getApplication();
$input=$app->input;
if ($input->getCmd('option')=='com_content'
&& $input->getCmd('view')=='article' ){
$cmodel = JModelLegacy::getInstance('Article', 'ContentModel');
$catid = $cmodel->getItem($app->input->get('id'))->catid;
echo $catid;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment