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.

Widgets

Discuss SilverStripe Widgets.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Remove HTML content widget


Reply

7 Posts   3855 Views

Avatar
henrik

13 January 2009 at 8:31am 18 Posts

What is the easiest way to remove HTML content widget. Seem to be unable to delete it the usual way in Blog widgets. When trying to delete it the widget disappears but the page can't be saved.

Avatar
Nivanka

24 January 2009 at 3:25pm Community Member, 395 Posts

try with deleting the widget codes and run db/build?flush=1

Avatar
Jacknife

19 February 2009 at 2:45am Community Member, 16 Posts

I have the same problem, I don't want to get rid of the widget but just remove it from a particular page. It deletes the HTML content but will not save or publish. I am guessing it is bugged.

Any ideas?

:D

Avatar
scaphis

6 March 2009 at 9:08am (Last edited: 6 March 2009 9:11am), Community Member, 8 Posts

Crazy workaround...

documenting this for myself and others (because I keep forgetting the steps!)

Ok here we go-

First Install the HTML Content Widget - db build flush etc...
Now the widget tab should be inside the blog holder with the html content widget inside.
drag it over to the widget area and type something in it (test)
click on the save and publish and that part should work.
Go back to the front end and do a db/build?flush=1
clear the cache on your browser and then refresh the admin.
Go to another page and do this and then go back to the blog (in the admin)
(You should see the wysiwyg editor now, but filled with html garbage instead of wys)
View html of of the wysiwyg by presssing html in the editors toolbar
ctrl+a select all and delete everything
insert or save it blank
now use the wysiwyg editor to create fabulous content - links - images etc.
Publish content, view in another window or tab.
Don't leave the admin widget section until you have it how you want it.

every time you leave the page and come back it will destroy what you did by reverting back to html, so dont publish after you leave and come back...

unless you want to publish html script

Avatar
FungshuiElephant

31 March 2009 at 12:01am (Last edited: 31 March 2009 12:05am), Community Member, 57 Posts

This bug has been submitted to the bugtracker (#2836)
I think it's related to http://www.silverstripe.org/widgets-2/show/255189?showPost=257378

Avatar
FungshuiElephant

31 March 2009 at 12:17am (Last edited: 20 April 2009 9:20pm), Community Member, 57 Posts

To remove the HTMLContentWidget you can simply delete and recreate the page or edit the HTMLContent widget so that it doesn't use the TinyMCE editor.

To edit the HTMLContentWidget:
Change the HTMLEditorField to a TextAreaField in the getCMSField function in HtmlContentWidget.php
Add?flush=1 and reload the CMS page you're editing.
You should now be able to delete the widget.

You can actually use the widget with this modified interface. Just paste HTML into the textarea in the CMS; it's only the javascript that adds the TinyMCE editor that's a bit broken.

Avatar
CHD

18 January 2012 at 11:12pm (Last edited: 18 January 2012 11:22pm), Community Member, 218 Posts

We got our widgets working on all pages eventually, here's our solution. Hopefully it helps!

http://www.clickheredigital.co.uk/blog/bad-widget-class-name-given-our-experience-with-widgets-on-any-silverstripe-page/