Show category alias for css class

Phoca Gallery - image gallery extension
gwmbox
Phoca Member
Phoca Member
Posts: 36
Joined: 20 Sep 2009, 06:42
Location: Western Australia
Contact:

Show category alias for css class

Post by gwmbox »

Can someone tell me what code I can use to display the top level category alias as a css class on a photo details page (non pup-up view of the large image).

So if I have a category with photos called Portfolio > Animals, I want to know how to get the alias for Portfolio, i.e. portfolio and be able to assign that value to a css class, e.g.

Code: Select all

<div id="phocagallery" class="pg-detail-view portfolio">
Thanks

GW
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49150
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Show category alias for css class

Post by Jan »

Hi, then you need to customize the code: to get information about category alias from database (it is loaded as standard) and paste this information into CSS rows:

components/com_phocagallery/views/category/tmpl/default.php

Jan
If you find Phoca extensions useful, please support the project
gwmbox
Phoca Member
Phoca Member
Posts: 36
Joined: 20 Sep 2009, 06:42
Location: Western Australia
Contact:

Re: Show category alias for css class

Post by gwmbox »

Hi Jan, thanks for the reply but I am not sure how to achieve what you said, if you could guide me further or provide me with a snippet of code that will help please.

I would have thought I need to use one of the files at

\components/com_phocagallery/views/detail/tmpl

To get the category (top level) to show where I need it to as it is on the details page (non popup) where I need it displayed.

EDIT: I am now using $this->item->catid which provides the cat id for each category, but not the top category. While that will do if there is a way to get the id or alias name of the top parent category that will be better.

Thanks
Post Reply