Jump to:

7940 Posts in 1543 Topics by 946 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » ImageGallery captions

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1189 Views
  • Bronwyn
    Avatar
    Community Member
    16 Posts

    ImageGallery captions Link to this post

    Hi, I'm trying to make a page on our dept website with photos of all the staff and students. I like the ease of ImageGallery, but I want to be able to put the person's name under their picture so we can search by name or by face. I've got as far as figuring out that the bit I want to edit is in $GalleryLayout, but this doesn't appear to be a file, or at least not one I can find. Am I going to find it easier to just create an Image DataObjectManager thing?

  • UncleCheese
    Avatar
    4085 Posts

    Re: ImageGallery captions Link to this post

    Yup. Use an ImageDOM. ImageGallery is just going to get in your way.

    You could also subclass ImageGalleryPage and ImageGalleryItem with your own classes. In your ImageGalleryPage subclass, add:

    protected $itemClass = "YourImageGalleryItemSubclass";

    And in YourImageGalleryItemSubclass, add all the custom fields you like.

  • RichMcNabb
    Avatar
    Community Member
    34 Posts

    Re: ImageGallery captions Link to this post

    Hi There,

    I have edited the GalleryUI_layout.ss file so it includes the image and caption below it -

    <% control GalleryItems %>
    <li>$GalleryItem</li>
    <li>$Caption</li>
    <% end_control %>

    Is there a way I can make the Caption a link similar to the specific GalleryItem? Cheers!

    - Rich

  • ShaneLumos
    Avatar
    Community Member
    11 Posts

    Re: ImageGallery captions Link to this post

    hello UncleCheese
    I am new at a lot of this with silverstripe and I would like to make the ImageGallery Caption be able to be multiline when on hover and on click can you help me this is the website http://www.lumoswebdesign.com.au/portfolio/album/website

  • UncleCheese
    Avatar
    4085 Posts

    Re: ImageGallery captions Link to this post

    Well there are a number of ways to do that, but if you're not comfortable with programming, then I'd say the easiest solution is to wrap the caption in a <pre> tag.

    ---------------
    Silverstripe tips, tutorials, screencasts, and more. http://www.leftandmain.com

  • ShaneLumos
    Avatar
    Community Member
    11 Posts

    Re: ImageGallery captions Link to this post

    thank you UncleCheese

    That is good can you tell me in what file in ImageGallery I would do the modify code in.
    cheers
    shane

  • chillburn.com.au
    Avatar
    Community Member
    12 Posts

    Re: ImageGallery captions Link to this post

    If anyone is interested, I helped shane by editing the prettyphoto [image_gallery/gallery_ui/prettyphoto/javascript/jquery.prettyPhoto.js] javascript source file.

    What we did is add a replace to the title attribute.

    Line 135:
    change
    descriptions.push($(this).attr('title'));
    to
    descriptions.push($(this).attr('title').replace(/\n/g,'<br />'));

    and line 140 change
    descriptions = ($(this).attr('title')) ? $(this).attr('title') : '';
    to
    descriptions = ($(this).attr('title')) ? $(this).attr('title').replace(/\n/g,'<br />') : '';

    Cheers.

  • ShaneLumos
    Avatar
    Community Member
    11 Posts

    Re: ImageGallery captions Link to this post

    thank you that did the job

    1189 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.