Page 1 of 2

Description in lightbox effect

Posted: 21 Jun 2010, 15:40
by jodiewere
Hi, how do I put description inside the lightbox effect please

Also in the category the words/title are going to right of the image box and not underneath where do I change this

Thanks

Re: Description in lightbox effect

Posted: 24 Jun 2010, 12:06
by Jan
Hi, sorry not sure what exactly you mean:
Hi, how do I put description inside the lightbox effect please
category - you can customize the default view, search this forum as theare are a lot of guides which files and where to change.

Jan

Re: Description in lightbox effect

Posted: 27 Jun 2010, 04:22
by byron
Hi

same here
we are using slimbox but there is no way to get the images description to show up on the popup.

we want the name on the thumbnail/gallery and then on the popup we want the enlarged phot plus more description.

any hints on where to change this in the code would ne most approciated.

This is quite urgent for me,

Regards
Byron

Re: Description in lightbox effect

Posted: 27 Jun 2010, 14:36
by imperialWicket
If you use the Modal Popup (I think this is default), the description display is a configuration parameter option, and it will display when the image popup is displayed - but not during the slideshow.

If you use Slimbox, the javascript library uses the anchor tag details to populate its arrays for the image popup and slideshow displays; if you edit the anchor tag output for your images, the changes will appear in your overlay window.

You can accomplish this in /components/com_phocagallery/views/category/tmpl/default.php.

The original file includes (near line 120):

Code: Select all

echo '<a class="'.$value->button->methodname.'"';
		if ($value->type == 2) {
			if ($value->overlib == 0) {
				echo ' title="'. $value->title.'"';
			}
		}
		echo ' href="'. $value->link.'"';
Manually appending the image description to the image title text in the title attribute of the anchor tag will affect the Slimbox display. Something like this works for me:

Code: Select all

echo '<a class="'.$value->button->methodname.'"';
		if ($value->type == 2) {
			if ($value->overlib == 0) {
				echo ' title="'. $value->title.' - '.strip_tags($value->description).'"';
			}
		}
		echo ' href="'. $value->link.'"';
Make sure you strip the tags, the description value that is stored includes html tags that will ruin your display. Also note that I did not test this extensively. It shouldn't cause issues for non-Slimbox overlay windows, but I can not guarantee that.

Hope this helps - good luck.

Re: Description in lightbox effect

Posted: 28 Jun 2010, 07:41
by byron
thanks, this looks promising will try it out tonight.

Re: Description in lightbox effect

Posted: 17 Aug 2010, 23:11
by cyates
Thanks very much for this code snippet. Using this (in PhocaGallery 2.7.4), I was able to generate a title/description combination when using the Slimbox detail window. However, it only works when I click from a category display of images to get to the detailed image.

What I would also like to do is to create the same title/description detailed Slimbox display when clicking from an image inserted into an article using the Phoca Gallery plugin. Is there a similar php file modification which would enable this?

Thanks in advance for any help you might provide!

Re: Description in lightbox effect

Posted: 18 Aug 2010, 02:52
by imperialWicket
The plugin is rendered with /plugins/content/phocagallery.php.

I am guessing the same update is required around line 1233 (line reference from version 2.7.2 of Phoca Gallery Content Plugin) of that file in this code block:

Code: Select all

if ($enable_overlib == 0) {
         $output .= ' title="'.$image->title.'"';
}

Re: Description in lightbox effect

Posted: 18 Aug 2010, 13:41
by cyates
Yes. Making a similar change to add strip_tags($image->description) at the location you have indicated works perfectly!
Thanks for the help!

Re: Description in lightbox effect

Posted: 25 Aug 2010, 19:56
by kruwt
Hi, I have tried the given solutions, and it works also perfect for me.

However, when using the RandomFoto module, these changes does not work. I guess I have to make elsewhere 'in the random module code' the same changes. Where can I do that?

Thanks for your help!

Re: Description in lightbox effect

Posted: 26 Aug 2010, 12:56
by imperialWicket
Assuming you mean the Phoca Gallery Image Module:

A similar update is needed in /modules/mod_phocagallery_image/mod_phocagallery_image.php.

One instance is around line 816 (version 2.7.1 of the module), add the description after strip_tags():

Code: Select all

.'<a class="'.$button->methodname.'" title="'.$valueImages->title.' - '.strip_tags($valueImages->description).'" href="'. JRoute::_($valueImages->link).'"';
There are multiple instances of this output in the code, 816 controls the default configuration. Searching that file for "$valueImages->title" will show you all the places it is stored or used. Anywhere it is embedded in an anchor tag like the above code snippet is worth changing.

Good luck!