Jump to content

[ip.content] fields and permission : default message


action-reaction

Recommended Posts

Posted

Hello,

I hide a field with the permission set. Only one groupe can read this field.
Instead, other members must get a message "you have to change your group, etc..."
 

How to display that message ? I know I have to test the user's group, with a condition in the template (I remember, I have done that a long time ago).
But now, what's the correct code, please ?


Regards

 

NB : this should be a default feature.

 

Posted

You will need to add the field in templates like 

{{if \IPS\Member::loggedIn()->member_group_id === 4}}
	{$record->customFieldDisplayByKey('my_key', 'listing')|raw}
{{else}}
    you have to change your group, etc...
{{endif}}

 

More info: 

 

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...