Jump to content

Show For Group Only in Pages


Brian

Recommended Posts

Posted

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.

Posted

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

Posted
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. 

Posted

@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.

Archived

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

  • Recently Browsing   0 members

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