Keyword
Please note that official support for commercial extensions & templates is provided in the Subscriber Help Desk.
Support requests should ONLY be directed there and require an active subscription plan.
This forum board is to be used for archive purposes and knowledge exchange ONLY.

Use file names for captions with Simple Image Gallery Pro

  • Neil Forrester
  • Neil Forrester's Avatar Topic Author
  • Offline
  • Junior Member
More
11 years 6 months ago #52678 by Neil Forrester
Here's a little trick for anyone out there wanting to display the image file name for the captions in Simple Image Gallery Pro.

Why might you want to do this?
Well, imagine you have a photography website and you're putting lots of images up in galleries. You might not want to write a caption for each image but you might want people to be able to reference them so this is a great work around.

To display image file names as the captions in Simple Image Gallery Pro you will need to do the following.

Create an override of the Layout you are using for your thumbnails. Read here how to do so www.joomlaworks.net/docs/simple-image-gallery-pro under "MVC templates: the power to customize the look of your galleries".

Open the file default.php located in your template folder. Your path should look like this: templates/Your_template/jw_sigpro/Layout name, i.e Classic/

Locate the following elements:

<span class="sigProPseudoCaption"><b>echo $photo->captionTitle;</b></span>
<span class="sigProCaption" title="echo">captionTitle;">echo $photo->captionTitle;</span>

Replace with:

<span class="sigProPseudoCaption"><b>echo $photo->captionTitle;</b></span>
<span class="sigProCaption" title="echo">captionTitle;">echo preg_replace('/\.\w{3,4}$/i', '', $photo->filename);</span>

This will display the image file name and remove the .jpg extension.
You still need to configure Simple Image Gallery Pro to display captions in the backend.

Thanks,
Neil.

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum