2

I need to implement some business rules based on the following:

  1. The current user's {group_id}
  2. The group id of the author of a particular Channel entry

I need to implement this rule within the {exp:channel:entries}, I suppose. In that loop, I'll have access to {author_id}, which possibly could be used somehow to get it's associated group id???

5

Documentation is a good place to start:

http://ellislab.com/expressionengine/user-guide/templates/globals/single_variables.html

http://ellislab.com/expressionengine/user-guide/modules/member/index.html#custom-profile-data-tag

{member_group} or {group_id}
{member_id}

also (if in channel:entries tag pair and don't want conflict):

{logged_in_member_id}
{logged_in_group_id}

Entry Authors details:

{exp:channel:entries}
    {author_id} or {member_id} will be the same inside entries loop
    {group_id} will be authors group inside entries loop
{/exp:channel:entries}

Get custom member details:

{exp:member:custom_profile_data member_id="?????"}
{/exp:member:custom_profile_data}
| improve this answer | |
  • This seems problematic. In the loop, I need to implement some sort of business logic that needs to compare the CURRENT USER's group id and the AUTHOR's group id. You're saying that the value of {group_id} depends on whether or not it's in the {exp:channel:entries}? – ExpressionEngineNewbie Jul 14 '13 at 21:14
  • Use this inside channel:entries tag pair: {if {logged_in_group_id} == {group_id}}...{/if} – Peter Lewis Jul 15 '13 at 12:21
  • Thank you! After much hair-pulling, {logged_in_group_id} saved my scalp..! – Chris Kempen Oct 21 '15 at 10:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.