Skip to content

Instantly share code, notes, and snippets.

@betweenbrain
Created May 9, 2012 14:59
Show Gist options
  • Select an option

  • Save betweenbrain/2645141 to your computer and use it in GitHub Desktop.

Select an option

Save betweenbrain/2645141 to your computer and use it in GitHub Desktop.
Get category ID of Joomla article
JModel::addIncludePath(JPATH_SITE.'/components/com_content/models', 'ContentModel');
$model = JModel::getInstance('Article', 'ContentModel');
$article=$model->getItem();
foreach($article as $key => $value) {
if ($key = 'catid') {
echo "catid $value";
}
break;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment