Jump to:

7937 Posts in 1537 Topics by 944 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » [image_gallery] album cover images / thumbnails

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: 979 Views
  • HaraldC
    Avatar
    Community Member
    4 Posts

    [image_gallery] album cover images / thumbnails Link to this post

    Hi,

    New to SilverStripe and trying to set up a site presenting paintings (not mine) using the image_gallery module.

    1. How can I have the album cover images be displayed respecting their aspect ratio?
    The artist would not accept any cropping or distortion there.
    I hope for something like for the image thumbnails where only the height is entered.
    Leaving the width field in the configuration empty changed it to zero and I got the error already discussed here.

    2. How and where can I change the code so that the image thumbnails "blocks" of an album are also vertically aligned, i.e. like them being located centered in a table cell?

    3. Is there another way to limit the number of thumbnails shown in a row other then by their dimension as that is not very reliable when one has thumbnails with different widths.
    A table-like approach would also solve this problem. I also hate tables, but what alternative is there in SilverStripe?

    Thanks for any help!
    Harald

  • UncleCheese
    Avatar
    4085 Posts

    Re: [image_gallery] album cover images / thumbnails Link to this post

    Keep in mind, the templates and CSS that come with a module are just default implementations. You should copy them to your theme to override them as needed.

    1) Make a copy of /image_gallery/templates/Includes/AlbumList.ss and place it in YOUR_THEME_DIR/templates/Includes/AlbumList. Instead of:
       <% control FormattedCoverImage %>
          <img src="$URL" alt="" />
       <% end_control %>

    You could do something like:

    $CoverImage.SetHeight(100)

    Remember to ?flush=1.

    2) The CSS is themeable. Just copy /image_gallery/css/ImageGallery.css to YOUR_THEME_DIR/css/ImageGallery.css. Make any adjustments you need to get the presentation you like.

    3) Same thing as #1. Copy over ImageGalleryPage_album.ss to its parallel location in your theme, and make any changes you need. A table is not appropriate in this view since the gallery is not tabular data. To show fewer results per row, you can either change the width of the LI tags, increase their margins/padding, increase the size of the thumbnails (on the Configuration tab in the CMS), or decrease the width of the containing UL -- all of which can be done with your override templates or stylesheet.

  • HaraldC
    Avatar
    Community Member
    4 Posts

    Re: [image_gallery] album cover images / thumbnails Link to this post

    Hi UncleCheese,

    That was quick! Thank you.
    I will try to apply that in the next days (quite busy now!).

    Harald

  • HaraldC
    Avatar
    Community Member
    4 Posts

    Re: [image_gallery] album cover images / thumbnails Link to this post

    UncleCheese wrote:
    1) Make a copy of /image_gallery/templates/Includes/AlbumList.ss and place it in YOUR_THEME_DIR/templates/Includes/AlbumList. Instead of:
    <% control FormattedCoverImage %>
    <img src="$URL" alt="" />
    <% end_control %>

    You could do something like:

    $CoverImage.SetHeight(100)

    Remember to ?flush=1.
    ----

    I have done that (and the rest), but did not change anything else.
    There is no change, the cover images are still displayed strictly according to the width and height settings on the configuration page.

    Harald

  • UncleCheese
    Avatar
    4085 Posts

    Re: [image_gallery] album cover images / thumbnails Link to this post

    Oh, whoops. there's a typo in my original post. That should say "YOUR_THEME_DIR/templates/Includes/AlbumList.ss"

  • HaraldC
    Avatar
    Community Member
    4 Posts

    Re: [image_gallery] album cover images / thumbnails Link to this post

    No problem, I guessed that and had copied it as ".../AlbumList.ss" already. So that's not an issue.
    But the problem of the cover images still exist. (I did not test any further yet.)

    Newbie question, just to be sure: to "?flush=1" as you said, I entered "http://my.domain.com/?flush=1". Was that correct?
    (So far I did not quite understand when and where and how to apply "/dev/build" / "?flush=1" (I thought that was replaced by "/dev/build") / "/dev/build?flush=all" as the documentation is not very consistent in this point.)

  • UncleCheese
    Avatar
    4085 Posts

    Re: [image_gallery] album cover images / thumbnails Link to this post

    /dev/build is used to update table definitions in the database. So if you modify the $db or $has_one array, you need to run that command. ?flush=1 is used when you create a new template. Silverstripe caches the template manifest, so you need to clear that and rebuild if you have created or modified a template.

    I can't really explain why you wouldn't be seeing the override template. Can you put some text in your new one and confirm that it isn't displaying? What are the exact paths of both the original and override templates?

    979 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.