Jump to:

22976 Posts in 11702 Topics by 2826 members

General Questions

SilverStripe Forums » General Questions » Moving to the next step, repeating divs

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 1150 Views
  • Mrfixer
    Avatar
    Community Member
    49 Posts

    Moving to the next step, repeating divs Link to this post

    Well time for me to move on to the next part of SS learning curve (love it by the way, excellent CMS), before when i have wanted to show images on a page i have added an upload field for each image into the CMS and called them into the template in such a way as:

    $Image1
    $Image2
    $Image3

    and so on, each call already wrapped in its own div, but now im wanting to go further im finding that this isnt giving me a lot of flexibility.

    Is there a way that i can have one image upload field (not wanting to clutter up CMS) and just one call, IE: $Allimages, where the div is not already coded into the page but actualy gets attached to each image when called at the frontend.

    Thanks

  • joshy
    Avatar
    Community Member
    57 Posts

    Re: Moving to the next step, repeating divs Link to this post

    Check out DataObjectManager or ComplexTableField. You can attach dataobjects through has_many in the model and then add 1 or many images to a particular page.

    Josh

  • duskydesigns
    Avatar
    Community Member
    15 Posts

    Re: Moving to the next step, repeating divs Link to this post

    Yea ive done it with dataobject manager as well. See the tutorials for dataobject manager. The resource example is a great starting point to create an easy repeater for images.

    I included an example i made not too long ago wich is a basic image repeater with title and description. Very basic. Maybe it will help you create what you want.

    Attached Files
  • Mrfixer
    Avatar
    Community Member
    49 Posts

    Re: Moving to the next step, repeating divs Link to this post

    Thanks to both of you for your input, i had a feeling that Data Object Manager was going to be the way forward as it seems to be the logical next step.

    @ Dusky,

    always helps to have a working code example for a reference, thanks
    Regards
    Martin

  • swaiba
    Avatar
    Forum Moderator
    1769 Posts

    Re: Moving to the next step, repeating divs Link to this post

    just to clarify uploadify is a stand alone module for this, dataobjectmanager uses that i think - both excellent, but when only one is required I'd use one

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