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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

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

Save data to DataObject using GridField?


Go to End


3 Posts   619 Views

Avatar
Vlad Belfort

Community Member, 55 Posts

2 April 2016 at 12:09am

I need CMS users to add a list of emails to a certain page type. Each page will have different email addresses added to it and once the page is published I'll need to retrieve it front-end...

Is there a way to accomplish this using GridField?.. I have created a DataObject called 'MailingLists' and in my page model linked them but all it does is retrieve data from that DataObject, I am only able to retrieve data, I haven't seen any way to add data.

Am I missing something? Is it possible to add/edit/delete records with GridField or is there some other way to do so?

Avatar
Vlad Belfort

Community Member, 55 Posts

2 April 2016 at 12:52am

Edited: 04/04/2016 9:29pm

Found out I need to use but it saves the data to all the pages for that page type.

Is there a way to make it for each individual article?

$config = GridFieldConfig_RelationEditor::create();

Instead of

$config = GridFieldConfig_Base::create();

To add information through GridField...

Avatar
Vlad Belfort

Community Member, 55 Posts

5 April 2016 at 4:28am

Edited: 05/04/2016 4:30am

Someone on StackOverflow answered. Heres a link to anyone who ever has similar problems :)

http://stackoverflow.com/questions/36407186/new-gridfield-item-on-each-page-silverstripe