Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
Brian Posted September 20, 2019 Posted September 20, 2019 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.
Jennifer M Posted September 21, 2019 Posted September 21, 2019 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
kmk Posted September 21, 2019 Posted September 21, 2019 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.
opentype Posted September 21, 2019 Posted September 21, 2019 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:
Jennifer M Posted September 21, 2019 Posted September 21, 2019 @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.
kmk Posted September 22, 2019 Posted September 22, 2019 This is a bug? I created a Text Area field and leave some default values...
opentype Posted September 22, 2019 Posted September 22, 2019 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.
kmk Posted September 22, 2019 Posted September 22, 2019 Resolved, I unselected Show in listing template
Recommended Posts
Archived
This topic is now archived and is closed to further replies.