Jump to:

513 Posts in 209 Topics by 259 members

Content Editor Discussions

SilverStripe Forums » Content Editor Discussions » turn off validation tinymce html editor in SS3

Forum for content editors and CMS users.

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

Page: 1
Go to End
Author Topic: 1228 Views
  • Molodoi
    Avatar
    Community Member
    6 Posts

    turn off validation tinymce html editor in SS3 Link to this post

    Hi everybody,

    I would to know "How can i turning off html validation in tinymce editor in Silverstripe 3?".

    I want to add all HTML5 (<article>... and more) as the html code below directly into my HTML editor :

    ... some html ...
    <input checked type="radio" name="slider" id="slide1" />
    <input type="radio" name="slider" id="slide2" />
    <input type="radio" name="slider" id="slide3" />
    <input type="radio" name="slider" id="slide4" />
    <div id="slides">
       <div id="overflow">
          <div class="inner">
             <article>
                <img src="images/slide/slide01.jpg" alt="#"/>
             </article>
             <article>
                <img src="images/slide/slide02.jpg" alt="#" />
             </article>
             <article>
                <img src="images/slide/slide03.jpg" alt="#" />
             </article>
             <article>
                <img src="images/slide/slide04.jpg" alt="#" />
             </article>
          </div>
       </div>
    </div>
       
    <div id="controls">
    <label for="slide1"></label>
    <label for="slide2"></label>
    <label for="slide3"></label>
    <label for="slide4"></label>
    </div>
          
    <div id="active">
    <label for="slide1"></label>
    <label for="slide2"></label>
    <label for="slide3"></label>
    <label for="slide4"></label>
    </div>
    <br />
    ... some html ...

    Does anyone have an idea?

    Thanks a lot

    Matt ; )

  • Molodoi
    Avatar
    Community Member
    6 Posts

    Re: turn off validation tinymce html editor in SS3 Link to this post

    First way, but not complete

    In framework/admin/_config.php

    In HtmlEditorConfig::get('cms')->setOptions(array(...

    Replace : 'valid_elements' => "@[id|class|... some constraints...",
    By : 'valid_elements' => "*

    • ",

      And replace : 'extended_valid_elements' => "img[class|src|... some constraints...",
      By : 'extended_valid_elements' => "*

    • ",

      That's a funky baby hacks, but, i'm always blocked for insert this blocks :

      <div id="controls">
      <label for="slide1"></label>
      <label for="slide2"></label>
      <label for="slide3"></label>
      <label for="slide4"></label>
      </div>

      <div id="active">
      <label for="slide1"></label>
      <label for="slide2"></label>
      <label for="slide3"></label>
      <label for="slide4"></label>
      </div>

      Does anyone have an idea?

  • Molodoi
    Avatar
    Community Member
    6 Posts

    Re: turn off validation tinymce html editor in SS3 Link to this post

    Please, help me tinymce make me crazy

  • Molodoi
    Avatar
    Community Member
    6 Posts

    Re: turn off validation tinymce html editor in SS3 Link to this post

    HtmlEditorConfig::get('cms')->setOption('formats', 'none');
    HtmlEditorConfig::get('cms')->setOption('valid_children', '*

    • ');
      HtmlEditorConfig::get('cms')->setOption('convert_newlines_to_brs', 'false');
      HtmlEditorConfig::get('cms')->setOption('force_br_newlines', 'false');
      HtmlEditorConfig::get('cms')->setOption('force_p_newlines', 'false');
      HtmlEditorConfig::get('cms')->setOption('remove_linebreaks', 'false');
      HtmlEditorConfig::get('cms')->setOption('apply_source_formatting', 'false');

      HtmlEditorConfig::get('cms')->setOption('cleanup_on_startup', 'false');
      HtmlEditorConfig::get('cms')->setOption('trim_span_elements', 'false');
      HtmlEditorConfig::get('cms')->setOption('verify_html', 'false');
      HtmlEditorConfig::get('cms')->setOption('cleanup', 'false');
      HtmlEditorConfig::get('cms')->setOption('convert_urls', 'false');

      HtmlEditorConfig::get('cms')->setOption('paste_auto_cleanup_on_paste','false');
      HtmlEditorConfig::get('cms')->setOption('paste_remove_styles','false');
      HtmlEditorConfig::get('cms')->setOption('paste_remove_styles_if_webkit','false');
      HtmlEditorConfig::get('cms')->setOption('paste_strip_class_attributes','false');
      HtmlEditorConfig::get('cms')->setOption('cleanup','false');

      There's no solution

    1228 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.