Remember me

Possible to get filename as Short Description ?

7 years 5 months ago #1

  • Marc's Avatar
  • Marc
  • Posts: 4
Hi,

Is it possible to have the gallery "find and use" the filename (without JPG extension) of pictures as "Short Description" in the thumbnail caption area ?

Also it seems no Title, Category Name or Short Description is visable in the lightbox once a thumb has been clicked ? Also here it would be great if the filename can be shown.

7 years 5 months ago #2

  • Artem's Avatar
  • Artem
  • Posts: 11342
Hi,

Here is solution, which replace title at Thumbnail and Title in Lightbox on file name, and will be without .jpg (extension type)

1. Update your Gallery to version 2.0.2
2. Go to: components/com_bagallery/helpers/bagallery.php
3. After Line 825 add this code:
$ext = JFile::getExt($image->url);
            $image->title = str_replace('.'.$ext, '', $image->name);

Regards,

7 years 5 months ago #3

  • Marc's Avatar
  • Marc
  • Posts: 4
Great tweak, worked for me, thanks buddy !

7 years 5 months ago #4

  • Artem's Avatar
  • Artem
  • Posts: 11342
You're welcome ;)

7 years 4 months ago #5

  • Qbik's Avatar
  • Qbik
  • Posts: 728
I have an idea about that

and i Modify it a little

it adds file name as title (and alt) without "_" and "-"

and put is as title if there is nothing write as title in settings, if You put something in title in backend it use your text, what do You think about that?

maybe You can add it to next release
//name as title
            if (!$image->title){
  			      $ext = JFile::getExt($image->url);
              $image->title = str_replace(array('.'.$ext,'_','-'), array('',' ',' '), $image->name);
			      }
            if(!$image->alt) 
                $image->alt = $image->title;

7 years 4 months ago #6

  • Artem's Avatar
  • Artem
  • Posts: 11342
Hi,

Thank you for your suggestion! :)
But, what about customers which don't wanna show anything in the title?!

Unfortunately, this question is not very popular, if users start asking more often about this, I'm sure feature will be added with some option in the admin panel

p.s. We trying to find the best balance between tons of options and easy of use.
Thank you for your understanding!

Regards,

7 years 3 months ago #7

  • Qbik's Avatar
  • Qbik
  • Posts: 728
ok, maybe yo can add switch for that so if someone want it it can switch it on and if no just disable it ;)

7 years 3 months ago #8

  • Artem's Avatar
  • Artem
  • Posts: 11342
Yes, as an option it would be nice :cheer:

Regards,
Powered by Kunena Forum