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

Field from has_one relation in CMS admin area


Go to End


737 Views

Avatar
JonShutt

Community Member, 244 Posts

23 November 2012 at 10:33am

Hi,

I have a shop, with orders. each order has a 'has_one' relation to a member, each member has notes.

In the admin, I'm trying to add a field to the 'order' page which lets the client view/edit the notes.

this works in displaying the notes on the page:
$fields->addFieldToTab("Root.Notes", new LiteralField("summary", $this->Member()->Notes, ''));

however, trying to an html field to view/edit the notes doesn't work
$fields->addFieldToTab("Root.Notes", new HTMLEditorField($this->Member()->Notes, 'Notes'));

Does anyone know a way of making this work?

Cheers