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

HTMLEditorField in CTF Pop-up


Reply


3 Posts   1130 Views

Avatar
Phill

Community Member, 77 Posts

9 November 2010 at 12:41am

Edited: 09/11/2010 12:43am

Hey

I'm trying to find out if its possible to have a HTMLEditorField in a CTF Pop-up because I'm currently having an issue where a HTMLEditorField is being converted to a Text field.

I've tried a search on this and found a topic in the archive with a similar problem [url=http://silverstripe.org/archive/show/1760]http://silverstripe.org/archive/show/1760[/url]

where Ingo says

"HTMLEditorField in CTF popup - don't go there, its a world of pain ;) seriously, there's too many optimizations specific to the main CMS UI to make this generically work on the popup."

is this still the case?

Thanks
Phil

Avatar
swaiba

Forum Moderator, 1799 Posts

11 November 2010 at 1:30pm

Yes, I am curious about this too, maybe there is a way of having a non-tinymce in a popup that someone has done instead?

Avatar
prawnstar

Community Member, 121 Posts

18 November 2010 at 2:07pm

Hi, Phill,

Sadly, I think this is still the case.

It's not full featured, but if you use Uncle Cheese's DataObjects Manager module you should be able to use SimpleHTMLEditorField instead of the standard CTF HTMLEditorField. Again, it's not as full featured, but generally it gets the job done (it does have an html view).

Otherwise the 'workaround' for this, if you need a full fledged editor, is to make pages instead of DataObjects. I.e., "MyClass extends Page" instead of "MyClass extends DataObject."

In your page controller that you want that class to be included in, call that class like:

public function MyFunction() {
   return DataObject::get_one("MyClass");
}

Then in your template.ss file:

<% if MyFunction %>
   <% control MyFunction %>
$SomeVariableFromYourClass
   <% end_control %>
<% end_if %>

Chris.b