Adding Category titles in categories view

Phoca Gallery - image gallery extension
mozzy
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 31 Mar 2011, 23:53

Adding Category titles in categories view

Post by mozzy »

Hello,

I've been trying to modify the code in the default categories file /categories/tmpl/default.php to add a "title" to the thumbnail image tags. I'd like to have the category title appear on mouse over but I have limited knowledge of using JHTML expressions and variables. The titles appear on each of the category pages but not in Categories view.
http://www.benquilty.com/bqcms/


I was wondering if someone could help or point me in the right direction.

The original line 89

Code: Select all

echo JHTML::_( 'image.site', $this->categories[$i]->linkthumbnailpath, '', '', '', str_replace('»', '-',$this->categories[$i]->title), 'style="border:0"');
Here's my edit.

Code: Select all

echo JHTML::_( 'image.site', $this->categories[$i]->linkthumbnailpath, '', '', '', str_replace('»', '-',$this->categories[$i]->title), 'style="border:0" title="{$this->categories[$i]->title}"' );
I've tried adding the categories title variable following the border style but it only parses the string, not the variable value. Probably something straightforward but I can't see it. :x

cheers
Mitchell
mozzy
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 31 Mar 2011, 23:53

Re: Adding Category titles in categories view

Post by mozzy »

Anyone have any ideas?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49297
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Adding Category titles in categories view

Post by Jan »

Hi, not on my PC now :-( so cannot give right advice, but just try to look to Joomla! framework API to see JHTML and there you should see the parameters for it.


Jan
If you find Phoca extensions useful, please support the project
mozzy
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 31 Mar 2011, 23:53

Re: Adding Category titles in categories view

Post by mozzy »

Thanks for the tip, Jan.

For anyone that needs this, here's the edited code. The array of additional attributes is the key.

Code: Select all

echo JHTML::_( 'image.site', $this->categories[$i]->linkthumbnailpath, '', '', '', str_replace('»', '-',$this->categories[$i]->title), array('title'=> str_replace('»', '-',$this->categories[$i]->title)),'style="border:0"');
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49297
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Adding Category titles in categories view

Post by Jan »

Ok
If you find Phoca extensions useful, please support the project
Post Reply