Jump to:

794 Posts in 408 Topics by 304 members

Widgets

SilverStripe Forums » Widgets » HTML widget in 2.3.0

Discuss SilverStripe Widgets.

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

Page: 1 2 3
Go to End
Author Topic: 7223 Views
  • ravid
    Avatar
    Community Member
    6 Posts

    Re: HTML widget in 2.3.0 Link to this post

    Modifying the tinymce-code is a quick and dirty way to fix this issue because it does not really solve the problem for a long time (update compatibility, etc.).
    The proper solution is to alter the silverstripe code to make it remove the editor from tinymces list of active editors before removing the widgets html object from the dom.

    You can leave your tiny_mce_src.js as it is and modify the “cms/javascript/WidgetAreaEditor.js” on line 126 like this (or use attached file):

    Change

    deleteWidget: function(widgetToRemove) {
       // Remove a widget from the used widgets column
       $('WidgetAreaEditor_usedWidgets').removeChild(widgetToRemove);
    }

    To

    deleteWidget: function(widgetToRemove) {
       // Remove the widgets htmleditor areas from tinymces list
       jQuery(widgetToRemove).find('textarea[id]').each(function () {
          var tinyId = jQuery(this).attr('id');
          if (tinyMCE.get(tinyId)) {
             tinyMCE.execCommand('mceFocus', false, tinyId);
             tinyMCE.execCommand('mceRemoveControl', false, tinyId);
          }
       });
       // Remove a widget from the used widgets column
       $('WidgetAreaEditor_usedWidgets').removeChild(widgetToRemove);
    }

    I will commit this changes to silverstripe to have this problem removed permanently for the future.

    Attached Files
  • ravid
    Avatar
    Community Member
    6 Posts

    Re: HTML widget in 2.3.0 Link to this post

    my previous post is related to silverstripe version 2.3.4

  • Jeramie
    Avatar
    Community Member
    34 Posts

    Re: HTML widget in 2.3.0 Link to this post

    I was able to correct the issue with Tiny MCE by applying the fix that FungshuiElephant referred to in this post http://www.silverstripe.org/widgets-2/show/258893?start=0#post261255

    I am using SS 2.3.4 and dont have any other widgets in use, so I am not sure if it affects other widgets, but it loads the Tiny MCE HTML editor properly on every visit to the Widget admin area.

  • CHD
    Avatar
    Community Member
    218 Posts

    Re: HTML widget in 2.3.0 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

    7223 Views
Page: 1 2 3
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.