Page 1 of 1

Display Image Description on Category View with Thumbnails

Posted: 28 Jul 2009, 04:11
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

Re: Display Image Description on Category View with Thumbnails

Posted: 28 Jul 2009, 13:23
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

Re: Display Image Description on Category View with Thumbnails

Posted: 28 Jul 2009, 21:20
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?

Re: Display Image Description on Category View with Thumbnails

Posted: 29 Jul 2009, 00:28
by Jan
Ok

Re: Display Image Description on Category View with Thumbnails

Posted: 27 Aug 2009, 20:21
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