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
Read and display category ID in template
-
pat01
- Phoca Member

- Posts: 32
- Joined: 22 May 2013, 16:06
- Jan
- Phoca Hero

- Posts: 49144
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Read and display category ID in template
Hi, sorry, I don't understand?
Jan
Jan
If you find Phoca extensions useful, please support the project
-
pat01
- Phoca Member

- Posts: 32
- Joined: 22 May 2013, 16:06
Re: Read and display category ID in template
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:
I'm looking for such a code the read the Phoca Gallery Categories IDs.
Thank you very much.
Pat
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;Thank you very much.
Pat
- Jan
- Phoca Hero

- Posts: 49144
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Read and display category ID in template
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
Jan
- 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
Jan
If you find Phoca extensions useful, please support the project
-
pat01
- Phoca Member

- Posts: 32
- Joined: 22 May 2013, 16:06
Re: Read and display category ID in template
OK Jan, thank you. I'll try with an override.
Pat
Pat
- Jan
- Phoca Hero

- Posts: 49144
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Read and display category ID in template
Ok
If you find Phoca extensions useful, please support the project