We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2901
    • 277 Posts
    Good morning
    I am working on an Revo Site, in which I tend to add chunks and snippets in within TinyMCE. But as in Evol, TinyMCE keeps wrapping them inside paragraphs, which produces invalid output.
    in Evo there is a plugin that stops this (http://modxcms.com/forums/index.php/topic,28908.0.htmlt), however that does not work with Revo. Any idea on how this could be solved in Revo? I really think this should be a standard function.

    Thanks in advance!
      • 34127
      • 135 Posts
      In System Settings, clear the value of the tiny.forced_root_block setting. smiley
        • 2901
        • 277 Posts
        this is a solution I used to use before following plugin.
        $e = &$modx->Event;
        switch ($e->name) {
        
        case 'OnParseDocument':
        
                $replace = array(
                                 '<p>[!'    => '[!',
                                 '!]</p>'   => '!]',
                                 '<p>[*'    => '[*',
                                 '*]</p>'   => '*]',
                                 '<p>[['    => '[[',
                                 ']]</p>'   => ']]',
                                 '<p>{{'    => '{{',
                                 '}}</p>'   => '}}'
                                 );
                $this->documentOutput = str_replace(array_keys($replace), array_values($replace), $this->documentOutput);
        
        break;
        
        default: '';
        
          return;
        }


        that was a neat clean Solution, prevent the end user from making error’s.
          • 2901
          • 277 Posts
          Hi all.
          I still would like to solve this problem on a nice way. I’ve tried to adjust the plugin to Revo, but no luck. If one of the php cracks in this forum could have a look at this issue, I would also be prepared to cover the cost.
          I really think this is an essential feature, which should be a standard feature to modx <Revolution. Taking out forced_root_block is not the answer, as the end user will produce invalid content.

          Thanks a lot in advance.