Display Image Description on Category View with Thumbnails

Phoca Gallery - image gallery extension
hockey2112
Phoca Member
Phoca Member
Posts: 24
Joined: 28 Jul 2009, 03:41

Display Image Description on Category View with Thumbnails

Post by hockey2112 »

Hello,

Loving Phoca Gallery, really great stuff! Thank you so much for sure a great tool!

My question is this... Can you display the image description on the Category View (Thumbnail Page)? See the attached image for what I want to do... I want to display the stuff that is marked with the green-outlined box, and I would also love if I could tell Phoca to truncate the description and end it with a "..." like in the red circle, prompting the viewer to click for the whole description. Possible?

Thanks!

Peter

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

Re: Display Image Description on Category View with Thumbnails

Post by Jan »

Hi, this needs to be customized in the code.

Description is loaded in category view so it can be easily done.

In \components\com_phocagallery\views\category\tmpl\default.php

you should find the place where you want to add your description and add e.g. there:

echo $value->description

if you want it will be cut, you can use Phoca Gallery Method:

echo PhocaGalleryText::wordDelete($value->description, 250, '...');
the second parameter is number of characters, the third parameter is end character

Jan
If you find Phoca extensions useful, please support the project
hockey2112
Phoca Member
Phoca Member
Posts: 24
Joined: 28 Jul 2009, 03:41

Re: Display Image Description on Category View with Thumbnails

Post by hockey2112 »

Jan wrote:Hi, this needs to be customized in the code.

Description is loaded in category view so it can be easily done.

In \components\com_phocagallery\views\category\tmpl\default.php

you should find the place where you want to add your description and add e.g. there:

echo $value->description

if you want it will be cut, you can use Phoca Gallery Method:

echo PhocaGalleryText::wordDelete($value->description, 250, '...');
the second parameter is number of characters, the third parameter is end character

Jan

Jan,

Thank you!!! It worked perfectly.

Just to make sure I did it correctly, I changed this...

Code: Select all

		if ($value->type == 2) {

			if ($value->displayname == 1) {

				echo '<div class="phocaname" style="font-size:'.$this->tmpl['fontsizename'].'px">'

				.PhocaGalleryText::wordDelete($value->title, $this->tmpl['charlengthname'], '...').'</div>';

			}

			if ($value->displayname == 2) {

				echo '<div class="phocaname" style="font-size:'.$this->tmpl['fontsizename'].'px">&nbsp;</div>';

			}

		}
to this...

Code: Select all

		if ($value->type == 2) {

			if ($value->displayname == 1) {

				echo '<div class="phocaname" style="font-size:'.$this->tmpl['fontsizename'].'px">'

				.PhocaGalleryText::wordDelete($value->title, $this->tmpl['charlengthname'], '...').'</div>';

echo PhocaGalleryText::wordDelete($value->description, 250, '...');

			}

			if ($value->displayname == 2) {

				echo '<div class="phocaname" style="font-size:'.$this->tmpl['fontsizename'].'px">&nbsp;</div>';

			}

		}

Everything look good?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49297
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Display Image Description on Category View with Thumbnails

Post by Jan »

Ok
If you find Phoca extensions useful, please support the project
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49297
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Display Image Description on Category View with Thumbnails

Post by Jan »

Hi, you can display description in the boxes without changing the code, see:
https://www.phoca.cz/templatedemo/phoca-gallery
( https://www.phoca.cz/templatedemo/ )

the parameter is called:
Display Image Description in Box

see:
https://www.phoca.cz/documents/2-phoca-g ... -menu-item

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