21280 Posts in 5729 Topics by 2600 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 333 Views |
-
Are Arrayed CMSFields Possible?

7 September 2011 at 3:02pm
Howdy
I can't think of the right terminology to search the documentation/ interweb for a solution so I thought I'd ask here.
I want to extend the Page class so CMS users can upload and place images on a page (which gives us more control over where they place images compared to just inserting them into the HTML editor.)
Each image would need:
1. An upload field
2. A dropdown for placement (i.e. left, right, top, bottom)
3. A captionHowever I want users to be able to do this for as many images as they want. I could create (for example) 6 groups of image fields but this would look cluttered on the CMS, and there's always the chance a user wants to add 8 images.
The ideal solution would be to have a tab that creates a new set of fields every time an image is added.
Is this possible?
Cheers
Tama -
Re: Are Arrayed CMSFields Possible?

7 September 2011 at 8:50pm
Well you could represent those fields as a dataobject then attach a has_many relationship between your Page class and that new Dataobject.
Tutorial 5 covers the basics of dataobjects and relations: http://doc.silverstripe.org/sapphire/en/tutorials/5-dataobject-relationship-management
-
Re: Are Arrayed CMSFields Possible?

8 September 2011 at 9:17am
Thanks Will - that's what I'm after. Just couldn't think of the right search terms.
| 333 Views | ||
|
Page:
1
|
Go to Top |


