Gallery Module - Captions or Field Entries for each picture?

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
mtnmchgrl
Forum Members
Forum Members
Posts: 32
Joined: Sat Jan 29, 2011 3:50 pm

Gallery Module - Captions or Field Entries for each picture?

Post by mtnmchgrl »

I'm using...CMS Made Simple v. 1.9.2

I have a gallery with many subgalleries with images. They are all currently set to use Lightbox.

I don't know if I am searching for this topic incorrectly or what but I can't seem to find the info on the forums, so here goes...

When a visitor clicks on one of the pictures, all they see right now are the image, image title & comments. I have multiple things in the comments section that I want broken out on separate lines. Is there a way to do that by using <br /> tags??

This is my current code:

Code: Select all

<div class="img">
{if $image->isdir}
   <a href="{$image->file}" title="{$image->title}"><img src="{$image->thumb}"
alt="{$image->title}" /></a><br />{$image->title}
{else}
   <a href="{$image->file}" title="{$image->title}<br
/>{$image->comment|escape:'html'}" rel="lightbox[gallery]"><img
src="{$image->thumb}" alt="{$image->title}" /></a>
{/if}
</div>
It is displaying my comments like:
Image Here
Image Title
Image Comments; Image Comments 1; Image Comments 2; Image Comments 3; Image Comments 4

but I want them to display like:
Image Here
Image Title
Image Comments 1
Image Comments 2
Image Comments 3
Image Comments 4

So it's nicely separated out on a different line? Doable?

Or is there a way to different fields for each picture uploaded? Like if you were going to post the same stuff for each picture?
Instead of Title, Comment, can you add something like Title, Comment, Reference #:, Date, etc?
THANKS!
Jos
Support Guru
Support Guru
Posts: 4019
Joined: Wed Sep 05, 2007 8:03 pm

Re: Gallery Module - Captions or Field Entries for each pict

Post by Jos »

You might want to take a look at the first frequently asked question here: http://wiki.cmsmadesimple.org/index.php ... _Questions
mtnmchgrl
Forum Members
Forum Members
Posts: 32
Joined: Sat Jan 29, 2011 3:50 pm

Re: Gallery Module - Captions or Field Entries for each pict

Post by mtnmchgrl »

That is one of the first places I looked....so I have the naming convention figured out. Ex:
{$image->description.name}
{$image->description.value}

But where does this go in the for each loop? I've entered it in, but it's not showing up on the picture....
Jos
Support Guru
Support Guru
Posts: 4019
Joined: Wed Sep 05, 2007 8:03 pm

Re: Gallery Module - Captions or Field Entries for each pict

Post by Jos »

Seems to me the forumtopic in the first FAQ explains it well. You could also take a look at the original Lightbox documentation, see the about link in the gallery admin templates section.
mtnmchgrl
Forum Members
Forum Members
Posts: 32
Joined: Sat Jan 29, 2011 3:50 pm

Re: Gallery Module - Captions or Field Entries for each pict

Post by mtnmchgrl »

I just figured a work around this since I couldn't ever figure out how to modify the PHP.

I just put breaks (<br />) in between each item inside the image's comment box and that nicely put the different captions on a new line. I wasn't sure it would recognize HTML but it did!

Ex Code:
Item Type <br /> $50 <br /> 7'Hx8'W <br /> A longer description here.

This looks like this:

Item Type
$50
7'Hx8'W
A longer description here.

This is probably not the BEST way to do this but it is a quick fix especially if you have someone not ultra familiar with PHP updating the picture's captions!
Post Reply

Return to “Modules/Add-Ons”