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

[SOVLED] Bug? TreeDropdownField hides SimpleHTMLEditorField


Reply

4 Posts   855 Views

Avatar
jizzman

13 February 2012 at 12:36am Community Member, 23 Posts

Hi,

Has anyone come across this? When I add a TreeDropdownField control to CMS popup the SimpleHTMLEditorField disappears. Removing the TreeDowndownField brings it back. Also, doesn't matter what order I add the fields.

Thanks,
J

I have small PHP class for a news item:

class NewsItem extends DataObject
{
static $db = array
(
'Heading_' => 'Varchar(100)',
'Body_' => 'HTMLText'
);
static $has_one = array
(
'Page_' => 'HomePage',
'Link_' => 'SiteTree'
);
function getCMSFields_forPopup()
{
global $simplehtml_default_controls; // just removes some buttons

return new FieldSet(new TextField('Heading_', 'Heading'),
new SimpleHTMLEditorField('Body_', 'News', $simplehtml_default_controls),
new TreeDropdownField('Link_ID', 'Link', 'SiteTree'));
}
}

Avatar
UncleCheese

15 February 2012 at 3:58pm 4085 Posts

Use SimpleTreeDropdownField.

---------------
Silverstripe tips, tutorials, screencasts, and more. http://www.leftandmain.com

Avatar
jizzman

15 February 2012 at 4:01pm Community Member, 23 Posts

Thanks Uncle Cheese! I'll give that a go. I just posted a comment on your site Left and Main about this thread.

Avatar
jizzman

17 February 2012 at 12:53am Community Member, 23 Posts

Yep, that did the trick.