753 Posts in 310 Topics by 289 members
| Go to End | Next > | |
| Author | Topic: | 6482 Views |
-
Re: HTML widget in 2.3.0

22 May 2009 at 11:41am Last edited: 22 May 2009 12:35pm
Hi I tried the fix you suggested in your last post FungshuiElephant, now when I move the widget over I get:
Fatal error: Class 'TextAreaField' not found in /home/kidscost/public_html/widgetHtmlContentWidget/HtmlContentWidget.php on line 24
Any thoughts?
-
Re: HTML widget in 2.3.0

24 May 2009 at 12:31am
It should be a TextareaField not a TextAreaField. Sorry.
-
Re: HTML widget in 2.3.0

26 May 2009 at 2:03am Last edited: 26 May 2009 2:38am
I have a feeling that this fix for checkboxes may also fix the problem with HTMLEditor fields not saving or saving with the content label included. Seemed to work with 2.3.1.
<br >
<br >It won't make the Tiny MCE editor appear as soon as the widget is added that requires a bit of javascript to assign the behaviour - just save and refresh the page to get that.
<br >
<br >You can change tinymce.template.js and/orWidgetAreaEditor.css if you don't like the editor toolbars sticking out of the side of the box. Or better still, override in you own files rather than in core.
<br >
<br >If you try it, please report back. -
Re: HTML widget in 2.3.0

26 May 2009 at 10:17pm Last edited: 26 May 2009 10:19pm
Thanks, I should have worked out The TextareaField .....
It's now not breaking I'll try the fix you suggested in your next post to see if I can get the widget to show on my page
-
Re: HTML widget in 2.3.0

21 June 2009 at 5:54pm
I had it working in 2.3.1 but needed to edit my content. Now I can't save and I can't even remove the widget altogether (clicking the red x). I have all kinds of jibberish appearing now. I'm very new to SS - is there another way to remove the widget?
Thx in advance.
-
Re: HTML widget in 2.3.0

2 July 2009 at 1:55am
You can delete a Widget from a WidgetArea by deleting the corresponding row from the Widgets table in the database. Just look through the table until you find the row with the right widget name. They're grouped by ParentID; the widgets from a given widgetarea all have the ParentID.
Be sure that you delete the right one!
-
Re: HTML widget in 2.3.0

18 August 2009 at 4:32am
I have just spent some time playing about trying to get this widget to save with the HTML editor.
The problem stems from the fact that the HtmlEditor field assumes that it will always be in the page. To get around this I had to amend the js source code slightly.
I amended the file: [site_root]\jsparty\tiny_mce2\tiny_mce_src.js.
Search for "save : function(o)" (~ line 7730)
All you want to do is add a check to determine if the element exists or not.
Replace the following code:
if (!/TEXTAREA|INPUT/i.test(e.nodeName)) {
e.innerHTML = h;
// Update hidden form element
if (f = DOM.getParent(t.id, 'form')) {
each(f.elements, function(e) {
if (e.name == t.id) {
e.value = h;
return false;
}
});
}
} else
e.value = h;with this code:
if( e )
{
if (!/TEXTAREA|INPUT/i.test(e.nodeName)) {
e.innerHTML = h;
// Update hidden form element
if (f = DOM.getParent(t.id, 'form')) {
each(f.elements, function(e) {
if (e.name == t.id) {
e.value = h;
return false;
}
});
}
} else
e.value = h;
} -
Re: HTML widget in 2.3.0

30 November 2009 at 3:43pm
Hi AlexR,
thanks for that fix. Wrapping the "if( e ) {" ... "}" code around works well. I initially wrote the widget but didn't have the time to fix the problem. But as it seems it just doesn't work any more since Silverstripe has the editor bar in the text field itself (which is a good choice except for widgets). If anyone knows a way to fix the problem in the widget code only without changing the core code please post it here. I still think it would be a simple yet useful widget.
Cheers!
Anatol
| 6482 Views | ||
| Go to Top | Next > |




