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

predefine page field


Go to End


3 Posts   1255 Views

Avatar
baniakjr

Community Member, 4 Posts

15 October 2010 at 8:38am

Hi,

I didn't really know how to name the topic. That's probably also the reason why I haven't found answer, so if that was already answerd, sorry for another post.

My point is. I would like to create page field (like author in news or place in calendar) but as a drop down list. But the elements of the list should be taken from table and this table should be avaliable to back-end user.

I need to let article editor to choose place where ceratin event is happening from avaliable locations. He also should be able to add or delete those locations in easy way (best solution would be table just like users, editable from cms).

Sorry if my english isn't the best.

Avatar
JonoM

Community Member, 130 Posts

15 October 2010 at 6:57pm

You could try a HasOneDataObjectManager http://doc.silverstripe.org/modules:dataobjectmanager#relation_dataobjectmanagers or use HasOneComplexTableField out of the box, I think you would have to define Location as a data object type with a has many relation to your pagetype first and define your pagetype as having a has one relation to Location.

More on that: http://doc.silverstripe.org/tutorial:5-dataobject-relationship-management

Avatar
baniakjr

Community Member, 4 Posts

17 October 2010 at 9:36am

Thank you, that was most helpful.