Page 1 of 1

Read and display category ID in template

Posted: 01 Sep 2014, 08:21
by pat01
Hello

I have some nested categories.
How can I read the current Phoca Gallery category ID to display it in the Joomla Template?

Joomla 2.5.24 / Phoca Gallery 3.2.8

Any help would be appreciated. Thank you very much!

Pat

Re: Read and display category ID in template

Posted: 01 Sep 2014, 22:33
by Jan
Hi, sorry, I don't understand?

Jan

Re: Read and display category ID in template

Posted: 02 Sep 2014, 08:25
by pat01
Hello Jan

Example:

==> Top-Level Category Fruits (ID 1)
==> ==> Sub-Category Apples (ID 2)

The user klicks Apples.

In the frontend I want to display: You are in Category ID 2 with Top-Category ID 1.

Inside of the index.php from the template I need some code to read the Phoca Gallery Category IDs.

For example with the following code I can read the Menu Itemid:

Code: Select all

$app   = JFactory::getApplication();
$menu   = $app->getMenu();
$activeId = $menu->getActive()->id;
I'm looking for such a code the read the Phoca Gallery Categories IDs.

Thank you very much.

Pat

Re: Read and display category ID in template

Posted: 06 Sep 2014, 01:03
by Jan
Hi, really not sure if your template can read the id directly:

- you can read it when you overwrite the html output with the template
- or you can try to get the ID but depends in which view you are - if you are in category view - you can get only one ID - the current category - in get value, there is only one ID - of the current category - to get other IDs - e.g. from parent or subcategories - you need to run sql query and get the info from database :idea:

Jan

Re: Read and display category ID in template

Posted: 06 Sep 2014, 08:27
by pat01
OK Jan, thank you. I'll try with an override.

Pat

Re: Read and display category ID in template

Posted: 07 Sep 2014, 15:17
by Jan
Ok