Jump to content

Show For Group Only in Pages


Brian

Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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. 

Link to comment
Share on other sites

Archived

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

  • Recently Browsing   0 members

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