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.

General Questions /

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

predefine page field


Reply


3 Posts   872 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, 103 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.