4572 Posts in 1316 Topics by 981 members
Customising the CMS
SilverStripe Forums » Customising the CMS » HTMLEditorField
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba
|
Page:
1
|
Go to End | |
| Author | Topic: | 1242 Views |
-
HTMLEditorField

21 October 2009 at 4:45am
Hi,
I'm writing a module to extend SilverStripe. In the module I create serveral form fields (TextField, TextareaField and so on). Furthemore I can save everything into my MySQL database. But there is a problem: I can't save the modified content of an HTMLEditorField. If I edit manually the HTML content in the database, it will displayed without any problems. But in the CMS Backend no chance, the content will ignored. The database array field is set to 'HTMLText'. So this isn't the problem.
My function getEditForm($id) return form. The AJAX request works! So I looked into the requested object and there is no value of the form field with the HTML text. If I changed the HTMLEditorField into a TextareaField everything works and the content will updated in the database. So my question is why does the requested object doesn't have the value of a form field of type HTMLEditorField.
Best regards,
Pascal
-
Re: HTMLEditorField

21 October 2009 at 6:49pm
Yes, my database field is a HTMLText. If I don't set this type, I will get a error in the function saveInto() on the class HTMLEditorField
So this isn't the reason for my problem. I hope you have another solution. -
Re: HTMLEditorField

2 November 2009 at 8:32am
> But there is a problem: I can't save the modified content of an HTMLEditorField
So no content is saved at all? Or saved as escaped HTML instead of raw? Does the data get submitted with the POST ajax request? (you can check this with getfirebug.com). Keep in mind that in case you're using some custom TinyMCE or otherWYSIWYG formfield thats not a plain HTMLEditorField, you'll likely need to tell the editor via JavaScript to extract the HTML *before* saving.
| 1242 Views | ||
|
Page:
1
|
Go to Top |



