Jump to:

10842 Posts in 2512 Topics by 1792 members

All other Modules

SilverStripe Forums » All other Modules » ImageGallery

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 678 Views
  • aTTi
    Avatar
    Community Member
    19 Posts

    ImageGallery Link to this post

    Hey Guys!

    I have a question about the Image Gallery and I was stuck in a conversion.
    Theres an exercise which i can't solve.
    There's only 4 Photos allowed per row, so if someone uploads 20 Photos in 1 Album it must see like:

    (Photo)(Photo)(Photo)(Photo)<br>
    (Photo)(Photo)(Photo)(Photo)<br>
    (Photo)(Photo)(Photo)(Photo)<br>
    (Photo)(Photo)(Photo)(Photo)<br>
    (Photo)(Photo)(Photo)(Photo)<br>

    How can i do this?

    http://yfrog.com/jximagegalleryp

    Sorry for my bad english

    Best regards, aTTi

  • banal
    Avatar
    Community Member
    901 Posts

    Re: ImageGallery Link to this post

    There are several solutions to this. Here are two simple ones:
    1) CSS: Wrap all the Photos in a block (eg. a <div>) and set it's width to four times the width of a photo plus margin. Then apply float: left to the photos.

    2) PHP: Write a function that checks if the current position is a multiple of four. Look here for a recipe: http://ssbits.com/manipulating-every-nth-item-in-a-control-loop/

  • UncleCheese
    Avatar
    4085 Posts

    Re: ImageGallery Link to this post

    Yeah, just change the width of ul#gallery_layout.

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