Joomlatools Support Center

Get category name from ID

I'm using the Filtered Document view to display a list of documents from multiple different categories. I'd like to also show the category names. I know there is a ($60!!!) extension that can do this plus much more, but I simply need a method to get the category name from it's id in /com_docman/views/documents/tmpl/list.php.

Is there a categories model I can load or other method I can use to get this category name?

Cheers,

Paul

Answer

Posted 5 years ago by Ercan Ozkaya Staff

Hi Paul, You do not need to use a separate model to fetch the category name.
The $document object includes category in a property named category_title.

The following will give you the category name:

$document->category_title


Does that help?

There are 3 more comments in this ticket.
Subscribe or login to join the discussion!

Paul Holmes
09.09.14
Answered

System Information

2.0
n/a
n/a
n/a