Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

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

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

Moving to the next step, repeating divs


Go to End


5 Posts   1725 Views

Avatar
Mrfixer

Community Member, 49 Posts

28 April 2011 at 8:34pm

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

Avatar
joshy

Community Member, 57 Posts

1 May 2011 at 4:16am

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

Avatar
duskydesigns

Community Member, 15 Posts

2 May 2011 at 3:02am

Edited: 02/05/2011 3:03am

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
Avatar
Mrfixer

Community Member, 49 Posts

2 May 2011 at 8:25pm

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

Avatar
swaiba

Forum Moderator, 1899 Posts

2 May 2011 at 9:00pm

Edited: 02/05/2011 9:00pm

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