We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40404
    • 21 Posts
    I'm successfully using several Custom Resource Classes in 2.4.2 with custom fields added in to the create and update Manager forms. I don't want my content editors to see all of my custom fields, though, only some. For core fields, I can control this via Form Customization. What's the best way to do this for CRC fields? I don't want to move them to a separate tab, or they'll get missed. I just want to hide/show certain fields based on User Group.

    This question has been answered by smaddock. See the first response.

    • discuss.answer
      • 40404
      • 21 Posts
      Okay this ended up being super simple. Just run this snippet once.

      <?php
      $action_field = $modx->newObject('modActionField',array(
         'action' => 'resource/create',
         'name' => 'my_field_name',
         'type' => 'field',
         'tab' => 'modx-resource-main-left',
         'form' => 'modx-panel-resource',
         'rank' => 5
      ));
      
      $action_field->save();