Page 1 of 1

Show category alias for css class

Posted: 17 Apr 2012, 09:19
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

Re: Show category alias for css class

Posted: 18 Apr 2012, 19:58
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

Re: Show category alias for css class

Posted: 19 Apr 2012, 02:27
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