We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19646
    • 31 Posts
    I am trying to use a tinyMCE rich text box in my module
    I have read around the forum unitl my poor little brain is spinning ! huh
    Sadly the code I have used (below) only produces a basic rich text box with bold underline, italics, cleanup, redo, undo, unordered and ordered lists.

    Please can anyone suggest how I call more of the buttons as per the doc content window of the pages in the manager.

    
    // New post
         // Get access to template variable function (to output the RTE)
         include_once($modx->config['base_path'].'manager/includes/tmplvars.inc.php');
    
         // invoke OnRichTextEditorInit event
    	 
      $replace_richtexteditor = array('postContent',);
    
         if(is_array($replace_richtexteditor))
          {
           $evtOut = $modx->invokeEvent('OnRichTextEditorInit',
                                        array('editor'   => $modx->config['which_editor'],
                                              'elements' => $replace_richtexteditor));
    
           if(is_array($evtOut))
            {
             echo implode("", $evtOut);
            }
          }
    
    


    kind regards

    Steve
      • 19646
      • 31 Posts

      How many people will identify with this ?? .......................

      I was having issues as described above.
      I test all of my functions in a snippet to ensure that they don’t produce errors - as in the module sometimes you can’t see the errors you just see that the output was not as expected / intended.

      I thought I’d just paste the code in my module and put up with a "basic rich text box" for now.

      When I ran the module "voila" there were all the buttons I had spent all afternoon trying to re-create !! grin >:( wink

      So I hope that this post now proves useful to other people who are module building..... share the modules folks

      regards

      Steve