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

    with mm_rules you can hide a field in resources that uses a specific template

    i have 2 resources that uses the same template, but in one resource, a specific field may not be visible.

    i can create a different template, but is there a way to hide a field in a specific resource

    this is the code to hide fields longtitle for non-admin-users in resources that uses template-id 4:

    mm_hideFields('longtitle','!1','4');


    but i want, for example, that template-id 4 will be a resource-id

    thanks
      • 4310
      • 2,310 Posts
      Something like ->
      $id_check = isset($_REQUEST['id']) ? $_REQUEST['id'] : $content['id'];
      if($id_check == 99){
      mm_hideFields('longtitle','!1','4');
      }

      Where 99 is the id of the document you wan to hide the field on
        • 39678
        • 68 Posts
        this works very good

        is this a safe code?

          • 4310
          • 2,310 Posts
          Quote from: tomvanminnebruggen at Mar 08, 2014, 04:26 PM


          is this a safe code?


          The ManagerManger plugin only works when logged in, so I'd hope so.
          Also it only checks the id of the document being loaded to then hides a field using Javascript.
            • 39678
            • 68 Posts
            okay,

            thanks for the help