Description Shows Instead of Title
Permalink Browser Info Environment
Hi Jordan,
Love the Fancybox, but I have a minor issue. The file Description displays on photos instead of the Title. I have a Description on some photo files because the slideshow add-on I use takes advantage of both. For the photos without Descriptions the Title displays correctly, so somehow Descriptions override Titles. Is there a fix for this?
Thanks
Spencer
Love the Fancybox, but I have a minor issue. The file Description displays on photos instead of the Title. I have a Description on some photo files because the slideshow add-on I use takes advantage of both. For the photos without Descriptions the Title displays correctly, so somehow Descriptions override Titles. Is there a fix for this?
Thanks
Spencer
Type: | Discussion |
---|---|
Status: | New |
This worked. Thanks!
Oh, hey Spencer! I didn't realize that was you when I originally replied (brain was kind of fried a few weeks ago). Glad it worked out -- as always feel free to get in touch with any other questions or issues.
-Jordan
-Jordan
Thanks Jordan. I'd like it to display both, so my guess is that I would add the getTitle code to the area above getDescription, yes?
Thx,
-Spence
Thx,
-Spence
Just follow my instructions above -- replace one line with the other. Be careful because there's another line above it that looks similar, just make sure you're working with the one that starts with "$image['description']".
Thanks. Will do.
-Spencer
-Spencer
Hi Jordan.
I also want it to display the title PLUS the description.
The default code is:
I have replaced
as shown above, with'
But it still only shows one of them at a time - If both the title and description are filled in, it will only show the description. If the title is the only one filled in, it will only show it then.
How can get it to show both at once?
I also want it to display the title PLUS the description.
The default code is:
$image['title'] = htmlspecialchars($fv->getTitle(), ENT_QUOTES, 'UTF-8'); $image['description'] = htmlspecialchars($fv->getDescription(), ENT_QUOTES, 'UTF-8');
I have replaced
$image['title'] = htmlspecialchars($fv->getTitle(), ENT_QUOTES, 'UTF-8');
as shown above, with'
$image['description'] = htmlspecialchars($fv->getTitle(), ENT_QUOTES, 'UTF-8');
But it still only shows one of them at a time - If both the title and description are filled in, it will only show the description. If the title is the only one filled in, it will only show it then.
How can get it to show both at once?
Id also like to change the yellow pop up when you hover over the thumbnail in the gallery.
It currently picks up the entire description - but it needs to just state the Title.
Where can I change this?
- Ive attached a screen shot
It currently picks up the entire description - but it needs to just state the Title.
Where can I change this?
- Ive attached a screen shot
Edit the file SITEROOT/packages/sortable_fancybox_gallery/blocks/sortable_fancybox_gallery/view.php, and find this line:
...and change it to this:
...and change it to this:
Keep these two lines the same:
...and below them, add this:
$image['title'] = htmlspecialchars($fv->getTitle(), ENT_QUOTES, 'UTF-8'); $image['description'] = htmlspecialchars($fv->getDescription(), ENT_QUOTES, 'UTF-8');
...and below them, add this:
$separator = ' - '; //change this to what you want to put in between the title and description (could be just a space, or a colon, or a dash... whatever) $image['title'] = $image['description'] = $image['title'] . $separator . $image['description'];
Awesome! Thanks - worked perfectly!
I just need to figure out the yellow hover/popup now :) - Id like to remove it completely.
I just need to figure out the yellow hover/popup now :) - Id like to remove it completely.
Did you not see my other response, or did it not work for you?
Opps, sorry, I thought they were 2 steps to getting the title to display along with the description, in the overlay.
No, it does not work. Ive just gone back in and played with it, and it is that line that controls it, but it also controls the title and discription in the overlay.
with line
I took out the last 'title' in the code to see what it controls, and the yellow popup disappeared as well as the title and description in the overlay.
No, it does not work. Ive just gone back in and played with it, and it is that line that controls it, but it also controls the title and discription in the overlay.
with line
I took out the last 'title' in the code to see what it controls, and the yellow popup disappeared as well as the title and description in the overlay.
Was needing this tweak and was very grateful for your clear posting. Good job.
The summary on the Sortable Fancybox Gallery Home page instruct users to use the 'Title' Field in File Manager>[image]>'Properties' to update lightbox captions. This is incorrect, since the 'Description' field is actually being pulled. I suggest either changing the instructions or the Add-on code reflect how the Add-on actually works.
Thank you for mentioning this -- not sure how I never noticed that typo before!
I have now updated the instructions to indicate that it's the "description" property that shows up in captions (not the "title").
Thanks again, and sorry for any confusion it may have caused.
-Jordan
I have now updated the instructions to indicate that it's the "description" property that shows up in captions (not the "title").
Thanks again, and sorry for any confusion it may have caused.
-Jordan
You can alter the block's controller.php file (in packages/sortable_fancybox_gallery/blocks/sortable_fancybox_gallery/controller.php), replace this line:
...with this:
If that's not exactly what you're looking for and you need more fine-grained control over individual images, I have a paid addon called "Deluxe Image Gallery" that is similar on the front-end to Sortable Fancybox but has more back-end editing options to set specific titles and descriptions.