Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted September 20, 20195 yr I want to show a snippet to the admin group only in different database templates (Pages). It's such a small line I rather not have to use a block. This code isn't working: {{if \IPS\Member::loggedIn()->member_group_id === 4}} This content only shows to members in the "Administrators" group (ID 4 in our example) {{endif}} Assuming the variables are slightly different for Pages vs the theme.
September 21, 20195 yr It's technically easier not to do it by just checking to see if the person is an admin (since technically you can add administrators without them being in the admin group) by using this: {{if \IPS\Member::loggedIn()->isAdmin()}} What you want admins to see. {{endif}} Additionally, in pages you can set fields so only specific groups can view them using the permissions for the custom fields. Hope that helps @Brian
September 21, 20195 yr 12 hours ago, Jennifer M said: Additionally, in pages you can set fields so only specific groups can view them using the permissions for the custom fields. Member have to edit record for the field editing? What I want is post a record and leave the field editable for some groups.
September 21, 20195 yr 1 hour ago, kmk said: Member have to edit record for the field editing? What I want is post a record and leave the field editable for some groups. Well, there is this field option:
September 21, 20195 yr @kmk each field has a "View", "Add", and "Edit" permission for each group. View is whether they can see it on the record, Add means that they have permission to see that field when they are creating a new record and Edit means whether or not they can edit it after the record has been created.
September 22, 20195 yr 3 minutes ago, kmk said: This is a bug? No. You use a “badge” field. It is not meant to hold a lot of information.
Archived
This topic is now archived and is closed to further replies.