expressionengine - How do you restrict content to a specific set of member groups? -


i using expressionengine 2.5.5 , have template multiple conditional statements...

{if logged_in && member_group == '1' ||  member_group == '7'} <div>content</div> {/if}  {if logged_in && member_group != '1' || member_group != '7'} <div class="authnotice"> <p>you not authorized view content.</p> </div> {/if}  {if logged_out} <div class="authnotice"> <p>please <a href="#">log in</a> or <a href="#">register</a>.</p>  </div> {/if} 

the second statement not work displays message "you not authorized view content" if conditions met.

does know best practice combining these 3 conditions in single template?

your second condition true. should change

{if logged_in && member_group != '1' || member_group != '7'} 

to

{if logged_in && member_group != '1' && member_group != '7'} 

disclaimer: have no idea expressionengine ;)


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -