Jump to:

794 Posts in 408 Topics by 304 members

Widgets

SilverStripe Forums » Widgets » Remove HTML content widget

Discuss SilverStripe Widgets.

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

Page: 1
Go to End
Author Topic: 3795 Views
  • henrik
    Avatar
    18 Posts

    Remove HTML content widget Link to this post

    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.

  • Nivanka
    Avatar
    Community Member
    395 Posts

    Re: Remove HTML content widget Link to this post

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

  • Jacknife
    Avatar
    Community Member
    16 Posts

    Re: Remove HTML content widget Link to this post

    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?

  • scaphis
    Avatar
    Community Member
    8 Posts

    Re: Remove HTML content widget Link to this post

    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

  • FungshuiElephant
    Avatar
    Community Member
    57 Posts

    Re: Remove HTML content widget Link to this post

    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

  • FungshuiElephant
    Avatar
    Community Member
    57 Posts

    Re: Remove HTML content widget Link to this post

    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.

  • CHD
    Avatar
    Community Member
    218 Posts

    Re: Remove HTML content widget Link to this post

    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/

    3795 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.