caption bellow each image of gallery

Admiror Gallery is free extension for Joomla! 1.6. Joomla! 1.7 and Joomla! 2.5 based websites. Admiror Gallery is all in one, a simple and instant solution for rendering image gallery from folder with images, but very flexible and adaptable.
Post Reply
Message
Author
mainuser
Posts: 1
Joined: Mon Apr 08, 2013 3:42 pm

caption bellow each image of gallery

#1 Post by mainuser »

Hello!

First of all, congratulations for the amazing work, specially for making it completely FREE!

I'm using your plugin with "classic" template and I'm pretty satisfied with it.
But.. I would like to be able to insert a caption for each image of the gallery.
Like:

Image Image
"This is my dog" ----------------------------------------------------------------------------- "This is my cat"

After clicking in the picture, it should open it in a popup and have the same caption, just like it usually does.

Is this possible?
Thanks!

Admiror Gallery 5 - Fundraising Campaign

User avatar
Vasiljevski
Developer
Developer
Posts: 1258
Joined: Sat Aug 14, 2010 9:31 pm
Location: Novi Sad, Serbia
Contact:

Re: caption bellow each image of gallery

#2 Post by Vasiljevski »

Classic template doesn't have that option for thumbnails, caption is only shown in popup.

But you can easily edit the Classic template and add caption.

Go to "plugins\content\admirorgallery\admirorgallery\templates\" make a copy of classic folder and name it "classicWithCaption". Then open the folder and open details.xml and change the gallery name, creation date, author (this is not mandatory, but it would be nice to do, so you could post your custom template here and take credits for it ;)

After that open index.php, this files defines how the gallery will be displayed(rendered) on the page.
Find:

Code: Select all

// Loops over the array of images inside target gallery folder, adding wrapper with SPAN tag and write Popup thumbs inside this wrapper
if (!empty($AG->images)) {
    foreach ($AG->images as $imageKey => $imageName) {
        $html.= '<span class="ag_thumb' . $AG->params['template'] . '">';
        $html.= $AG->writePopupThumb($imageName);
	$html.='</span>';
    }
}
And change it by adding a line that will add caption:

Code: Select all

// Loops over the array of images inside target gallery folder, adding wrapper with SPAN tag and write Popup thumbs inside this wrapper
if (!empty($AG->images)) {
    foreach ($AG->images as $imageKey => $imageName) {
        $html.= '<span class="ag_thumb' . $AG->params['template'] . '">';
        $html.= $AG->writePopupThumb($imageName);
	$html.= $AG->writeDescription($imageName);
	$html.='</span>';
    }
}
And that's all :)

Now you can also wrap $AG->writeDescription($imageName) in p or span tag add a CSS class so you could style the way caption is displayed.
template.css holds CSS styles for the template, so you can customize it :)
Help Admiror Gallery become even better,
give us a review on JED

Post Reply