Welcome, Guest. Please login or register.
Did you miss your activation email?

 
Advanced search

18642 Posts in 5527 Topics- by 9327 Members - Latest Member: Yannis

May 20, 2013, 01:24:43 AM
JOOM::GALLERY::FORUMJoomGallery 1.5 MVCFrontendUse the image description instead of the title as the lightbox caption.
Pages: [1] 2
Print
Author Topic: Use the image description instead of the title as the lightbox caption.  (Read 4131 times)
0 Members and 1 Guest are viewing this topic.
flint
Newbie
*
Offline Offline

Posts: 9



View Profile
« on: September 22, 2010, 01:45:46 PM »

Hi, is there are way to force JoomGalllery to use the image description instead of the title as the caption in the lightbox pop up?  One work-around is to enter the text of the description as the title but this can be a bit awkward in certain situations where the description is long.  

Thanks
« Last Edit: September 27, 2010, 08:00:57 PM by flint » Logged
flint
Newbie
*
Offline Offline

Posts: 9



View Profile
« Reply #1 on: September 27, 2010, 01:46:31 AM »

Ok this thread seems to contain the solution to what I seek.  I have not tested though so I cannot be certain whether it works or not http://www.forum.en.joomgallery.net/index.php?topic=2344.0.
Logged
glowworm
Newbie
*
Offline Offline

Posts: 21


View Profile
« Reply #2 on: September 27, 2010, 04:32:06 AM »

I don't think the solution offered in that thread works for the current version 1.5.5.2 the file isn't there to edit. I found no similar entries in the js files for slimbox in the assets directory. But what I know about code ain't worth ****!

I could badly do with a solution to this myself!

Logged
flint
Newbie
*
Offline Offline

Posts: 9



View Profile
« Reply #3 on: September 27, 2010, 06:05:31 PM »

Yup, sadly you are correct. The current version of JoomGallery does not feature that directory or file Sad.  However, there is some good news. I tried a small hack in another file which appears to work.

Open "../components/com_joomgallery/helpers/html/joomgallery.php" at line 1038 and change:

Code:
$link = $img_url.'" rel="lightbox['.$group.']" title="'.$image->imgtitle;

to

Code:
$link = $img_url.'" rel="lightbox['.$group.']" title="'.$image->imgtitle .'<br />'.$image->imgtext;

If you want to remove that image title and only disply the description,

Code:
$link = $img_url.'" rel="lightbox['.$group.']" title="'.$image->imgtext;

Please note that although these modifications appear to work fine, I have not tested them extensively so I am not certain what effect they will have on other parts of JoomGallery.
Logged
glowworm
Newbie
*
Offline Offline

Posts: 21


View Profile
« Reply #4 on: September 27, 2010, 07:28:57 PM »

Whey hey!  Yes

Nice job, that seems to resolve the missing description. If I experience any adverse effects I will report them in this thread.

Maybe you could mark your thread as solved.

Thanks for posting your solution.  Smile
Logged
flint
Newbie
*
Offline Offline

Posts: 9



View Profile
« Reply #5 on: September 29, 2010, 08:20:22 PM »

I just noticed a slight issue with this mode.  When the mouse pointer is placed on the image in Detail View, the tooltip displays raw html for the added line break tag "<br />" and paragraph tags "<p></p>" which are apparently automatically placed around the image description.  Thus the tooltip is presented as:

Image name<br /><p>Image description</p>

instead of

Image name
Image description


As a result I got rid of the "<br />" tag and used the PHP "strip_tags()" function to remove the "<p></p>" tags around the description.  Additionally to distinguish between the image title and description, I used an "&raquo;" (>>) separator.  The altered code looks like this:

Code:
$link = $img_url.'" rel="lightbox['.$group.']" title="'.$image->imgtitle . ' &raquo; ' . strip_tags($image->imgtext);
Logged
glowworm
Newbie
*
Offline Offline

Posts: 21


View Profile
« Reply #6 on: October 03, 2010, 05:07:40 PM »

Hi,

Thanks for sharing your update and the amended code.
Logged
marbert
Newbie
*
Offline Offline

Posts: 48



View Profile WWW
« Reply #7 on: February 13, 2011, 01:06:09 PM »

Please note that although these modifications appear to work fine, I have not tested them extensively so I am not certain what effect they will have on other parts of JoomGallery.

flint, thank you very much for your solve!

But I have a question:

Can I show in a detail view not a description of the photo, but description of the category (album)?
« Last Edit: February 13, 2011, 02:16:17 PM by marbert » Logged

Hightower
Newbie
*
Offline Offline

Posts: 4


View Profile
« Reply #8 on: February 13, 2011, 02:56:00 PM »

Thank you flint for the answer
First solution gives perfect descfription, just the way i want it, but ruins the tooltip
Second fixes the tooltip, but makes description (they are very long) a little cramped

Do you know where to fix tooltip? if we could correct the code part thats makes the tooltip
Weird part is that Frontend, general settings is actually disabled

Thanks a lot for your replies
Logged
canadarama
Newbie
*
Offline Offline

Posts: 4


View Profile
« Reply #9 on: March 15, 2011, 07:05:22 AM »

Thank you flint ...this works great. Smilewinkgrin

In my case I wanted to display author, not description:

../components/com_joomgallery/helpers/html/joomgallery.php at line 1038 and change:

Code:
$link = $img_url.'" rel="lightbox['.$group.']" title="'.$image->imgtitle;

to:

Code:
$link = $img_url.'" rel="lightbox['.$group.']" title="'.$image->imgtitle . ' &nbsp; ' . strip_tags($image->imgauthor);

...I also changed the "&raquo;" to "&nbsp;" to use a non-breaking space.
Logged
marbert
Newbie
*
Offline Offline

Posts: 48



View Profile WWW
« Reply #10 on: April 19, 2011, 11:49:19 PM »

Open "../components/com_joomgallery/helpers/html/joomgallery.php" at line 1038 and change:

Code:
$link = $img_url.'" rel="lightbox['.$group.']" title="'.$image->imgtitle;

to

Code:
$link = $img_url.'" rel="lightbox['.$group.']" title="'.$image->imgtext;

Please note that although these modifications appear to work fine, I have not tested them extensively so I am not certain what effect they will have on other parts of JoomGallery.

Flint, plz!!

After updating JoomGallery from 1.5.6.3 to 1.5.7 your method doesn't work...  Sad

Please, help again!
Logged

aHa
Developer-Team
Hero Member
*****
Offline Offline

Posts: 990


View Profile WWW
« Reply #11 on: April 20, 2011, 08:37:29 PM »

Hi,
to show image title and description

see file
/components/com_joomgallery/helpers/html/joomgallery.php
Line 1028
before
Code
$link = $img_url.'" rel="lightbox['.$group.']" title="'.$image->imgtitle;

then
Code
$link = $img_url.'" rel="lightbox['.$group.']" title="'.$image->imgtitle . ' &raquo; ' . strip_tags($image->imgtext);
Logged
marbert
Newbie
*
Offline Offline

Posts: 48



View Profile WWW
« Reply #12 on: April 20, 2011, 08:59:23 PM »

Hi,
to show image title and description

see file
/components/com_joomgallery/helpers/html/joomgallery.php
Line 1028
before
Code
$link = $img_url.'" rel="lightbox['.$group.']" title="'.$image->imgtitle;

then
Code
$link = $img_url.'" rel="lightbox['.$group.']" title="'.$image->imgtitle . ' &raquo; ' . strip_tags($image->imgtext);

Sorry, aHa, but your method is not work. I just tried it.

And why this problem not fixed in 1.5.7 (in update)?
Logged

pilot737
Newbie
*
Offline Offline

Posts: 2


View Profile
« Reply #13 on: April 21, 2011, 03:49:09 PM »

Hi

The method from aHa works for me but only when i open Pictures from most viewed or
random image module.
It doesnt work when i open pictures from the category-view.
Any ideas???
Logged
aHa
Developer-Team
Hero Member
*****
Offline Offline

Posts: 990


View Profile WWW
« Reply #14 on: April 22, 2011, 08:09:13 AM »

I'm sorry, there is a bug. Give us some time to look for a fix.
Logged
Pages: [1] 2
Print
Jump to:  

Theme orange-lt created by panic

Bad Behavior has blocked 813 access attempts in the last 7 days.