We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 16311
    • 28 Posts
    Apologies for this post, I inadvertently left in the opening and closing php tags. The plugin is working nicely now.
      • 16311
      • 28 Posts
      Just thought I’d share my little modification to this plugin. I found that when creating a new document and before selecting a template, the HideEditor plugin would fail and throw up an sql error.

      The reason for this is that as TobyL pointed out in the thread for the ’Customise Manager Fields’ plugin (http://modxcms.com/forums/index.php/topic,11203.msg81871.html#msg81871), the content[’template’] variable only gets set when the user makes a selection in the ’template’ drop-down menu in the document edit screen. So therefore when creating a new document the HideEditor plugin tries to run a query with a blank template id.

      So to fix this I did something similar to TobyL’s ’Customise Manager Fields’ modification:

      1. replace this line:
      global content;


      with these two lines:
      global $content,$default_template;
      $template_id = isset($content['template']) ? $content['template'] : $default_template;


      2. Replace this line:
      if (($e->name == 'OnDocFormRender') && ($content['template'] > 0)) {


      with this line:
      if (($e->name == 'OnDocFormRender')  && $template_id > 0) {


      3. And finally, replace this line:
      if (($template = $modx->db->getValue("SELECT content FROM {$modx->db->config['table_prefix']}site_templates WHERE id = {$content['template']}")) !== false) {


      with this one:
      if (($template = $modx->db->getValue("SELECT content FROM {$modx->db->config['table_prefix']}site_templates WHERE id = $template_id")) !== false) {


      Hopefully this’ll be helpful to anyone having the same issue I had.
        • 6726
        • 7,075 Posts
        Very cool addition, though I never came accross this problem I just might...
        Could be nice to submit this as a variant of the HideEditor plugin on the resources pages smiley
          .: COO - Commerce Guys - Community Driven Innovation :.


          MODx est l'outil id
          • 37550 ☆ A M B ☆
          • 711 Posts
          This is a great plugin however i am getting mixed results across browsers such as IE7, FF2 does anyone have a more updated plugin?

          Thanks
            http://www.onesmarthost.co.uk
            UK MODX Hosting with love.
            • 3781
            • 24 Posts
            anyone else find that hideeditor doesnt work in version 0.9.6.2? undecided
              • 10449
              • 956 Posts
              You can try changing it like this:

              	    // original: (comment or delete these 2 lines)
              //	    $output.= 'document.getElementById(\'ta\').parentNode.parentNode.previousSibling.style.cssText = \'display:none\';';
              //          $output.= 'document.getElementById(\'ta\').parentNode.parentNode.style.cssText = \'display:none\';';
              
                          // ... and replace with this:
              	    $output.= 'document.getElementById(\'ta\').style.display = \'none\';';
              


              The WYSIWYG option will still be visible, but at least the main content textarea will be hidden from view.
                • 3781
                • 24 Posts
                great! worked a treat! would be good if the WYSIWYG option wasnt visible - but i can live with it smiley
                  • 30223
                  • 1,010 Posts
                  Try ManagerManager instead. You can do what hideEditor does and a lot more. You can get ManagerManager from the repository
                    • 3781
                    • 24 Posts
                    even better! tongue thanks toby