How to hide custom fields for specific groups?

Post

Posted
Rating:
#4254 (In Topic #873)
TQ
Avatar
Standard member
TQ is in the usergroup ‘Well-settled’
Hi All,

I would like to create a custom download field that is only visable to specific groups, how might I go about this?

TQ

PS: I am using OCP 9.0.41

hamfiles.co.uk
Online now: No Back to the top

Post

Posted
Rating:
#4256
Avatar
Site director
Chris Graham is in the usergroup ‘Administrators’
Hi,

I think editing the CATALOGUE_DEFAULT_FIELDMAP_ENTRY_FIELD template to something like this would work:

Code

{+START,IF,{$OR,{$NEQ,{FIELD},Example},{$IS_IN_GROUP,2,3}}}
   {+START,IF_NON_EMPTY,{VALUE}}
      <tr>
         <th>{FIELD*}</th>
         <td>{VALUE}</td>
      </tr>
   {+END}
{+END}

In this example I'm making a field called 'Example' only show to groups #2 and #3.

(If the field is not named Example, or the group is #2 or #3, then show the field)


Become a fan of Composr on Facebook or add me as a friend. Add me on on Twitter. Follow me on Minds (where I am most active). Support me on Patreon

Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Online now: No Back to the top

Post

Posted
Rating:
#4262
TQ
Avatar
Standard member
TQ is in the usergroup ‘Well-settled’
Thank you Chris, works like a charm!

TQ
 

hamfiles.co.uk
Online now: No Back to the top
1 guest and 0 members have just viewed this.

Statistics

Users online:

Joe, deepu_ms, MVLipwig, babu, Philip, mytracker, 208 guests

Forum statistics:
  • 932 topics, 4,477 posts, 5,422 members
  • Our newest member is Sarawilliams7
Birthdays:
Back to Top