Description in lightbox effect

Phoca Gallery - image gallery extension
jodiewere
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 21 Jun 2010, 15:21

Description in lightbox effect

Post 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
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48704
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Description in lightbox effect

Post 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
If you find Phoca extensions useful, please support the project
byron
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 27 Jun 2010, 04:11

Re: Description in lightbox effect

Post 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
imperialWicket
Phoca Enthusiast
Phoca Enthusiast
Posts: 78
Joined: 28 Feb 2010, 15:39

Re: Description in lightbox effect

Post 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.
byron
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 27 Jun 2010, 04:11

Re: Description in lightbox effect

Post by byron »

thanks, this looks promising will try it out tonight.
cyates
Phoca Newbie
Phoca Newbie
Posts: 7
Joined: 06 Aug 2010, 19:11

Re: Description in lightbox effect

Post 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!
imperialWicket
Phoca Enthusiast
Phoca Enthusiast
Posts: 78
Joined: 28 Feb 2010, 15:39

Re: Description in lightbox effect

Post 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.'"';
}
cyates
Phoca Newbie
Phoca Newbie
Posts: 7
Joined: 06 Aug 2010, 19:11

Re: Description in lightbox effect

Post 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!
kruwt
Phoca Newbie
Phoca Newbie
Posts: 8
Joined: 07 Aug 2010, 22:47

Re: Description in lightbox effect

Post 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!
imperialWicket
Phoca Enthusiast
Phoca Enthusiast
Posts: 78
Joined: 28 Feb 2010, 15:39

Re: Description in lightbox effect

Post 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!
Post Reply