ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Assigning only a specific page to a single member

March 15, 2012 3:31am

Subscribe [5]
  • #1 / Mar 15, 2012 3:31am

    paolome

    75 posts

    Can I assign to each registered member, the visibility of only one specific page, preventing him from wiewing other pages assigned to members of the same group?

  • #2 / Mar 18, 2012 1:56pm

    Rob Allen

    3114 posts

    Yes you should be able to do that, there’s probably more than one way to do it but here’s one approach:

    1. In your Channel custom fields create a field, such as {entry_member_id} to hold the member’s ID (there may be some addons that can pull in member names into the field for easy selection).

    2. In your template use a conditional to check if the channel content is applicable to the logged in user:

    {exp:channel:entries channel="yourchannel"}
    
      {if entry_member_id == "{logged_in_member_id}"}
      Content goes here…
      {/if}
    
      {if entry_member_id != "{logged_in_member_id}"}
      Sorry you're not allowed to see this
      {/if}
    
    {/exp:channel:entries}
  • #3 / Mar 18, 2012 6:11pm

    Boyink!

    5011 posts

    Or you can assign them as author of the entry, and do a conditional in the channel entries loop looking comparing author id to the logged in user id.

  • #4 / Mar 26, 2012 4:28pm

    bluesonora

    90 posts

    hi mike-
    i have the same question and of course, this is a great response. THANK YOU!! 😊

  • #5 / Mar 26, 2012 5:02pm

    Boyink!

    5011 posts

    Double-dip!

    😉

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases