We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • Hi there,

    I just created a set of rules for my client to hide some manager forms (all the ressource setings etc.)
    Unfortunately, I cant hide the SEO-Tab, which is part of Menno Pietersens Extra "Flexibility".

    Can someone please point me to the right direction?

    Cheers,

    Guido
    • The SEO tab comes from the aptly named SEOTab extra. If you don't want it, you could disable the plugin or remove the extra. I'm not sure to what extent the Flexibility theme depends on it though, so you might need to make some template changes after that.
        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
      • Hi Mark,

        thank you for your input on this. I will look into it if I can disable the extra.
          • 23018
          • 353 Posts
          I believe you could trigger a plugin BEFORE StercSeo is triggered and use it toogle StercSeo on/off.

          This is just an idea, try it and send me a message if I made a fool out of my self...

          <?php
          
          /* 
          Toggle StercSeo
          
          trigger plugin on these events
          ------------------------------
          
          OnBeforeDocFormSave
          OnDocFormPrerender
          OnHandleRequest
          OnLoadWebDocument
          OnPageNotFound
          
          Set priority to 0
          
          Change the priority of these events for StercSeo to a higher value (1).
          
          */
          
          /* --------------------------- */
          // Change pluginID to fit the id 
          // of your StercSeo PLugin.
          
          $pluginId = 15;
          
          /* --------------------------- */
          
          $user = $modx->user;
          
          if($user->isMember('Staff')){ // or any other check
              $disabled = 1;
          }
          else{
              $disabled = 0;
          }
          
          $criteria = array('id'=> $pluginId);
          
          $plugin = $modx->getObject('modPlugin',$criteria);
          $plugin->set('disabled', $disabled);
          $plugin->save();
          return;
          
          


          Edit: Fixed a type at the bottom.
            Homepage: pepebe.de | MODX snippets (and other stuff) at github: https://gist.github.com/pepebe