Hello
Hope you can help me...
I currently have a group of 72 Web Users. I have assigned them into 18 groups of 4 using a customField "group" (i.e each person has been assigned a group number 1, 2, 3, 4...18)
I have a snippet call: [!WebLoginPE? &type=`users` &usersTpl=`usersGroupTpl` &usersList=`Groups:default:default:fullname:ASC:group(1)`!]
As you would expect, this returns a list of the four users in group 1
What I want to do is dynamically return the list of users that belong to the same group as the user viewing that list. (i.e if Bob was in group 11 he would see a list of the other users in his group)
I tried the obvious:
[!WebLoginPE? &type=`users` &usersTpl=`usersGroupTpl` &usersList=`Groups:default:default:fullname:ASC:group([+view.group+])`!]
But I dont think it accepts this syntax. Can anyone shed any light as to how I can pull through the group number of the current user?
Thanks
bS
-
☆ A M B ☆
- 24,524 Posts
That might work if you have the PHx plugin installed.
I would use a snippet to fetch the user’s group from the SESSION.
-
☆ A M B ☆
- 24,524 Posts
Create a snippet that gets the user’s group ID from the SESSION, then make a query to the database to fetch and return all the other users belonging to that group.
bigSlim,
Would you mind sharing your snippet to retrieve the group from the session? I'm doing almost the exact same thing with groups and working off your example.
Thanks!