Hi,

I'm currently working on a website that involves the Competition module. Each competition will consist of 4 "players". I want players to be able to see who they are competing against, which is why I created a custom field called "Grouping Code", giving them a specific group number, such as "CK-001", "CK-002", and so on. All 4 players will have the same unique group code.

I have a View set up, but I'm having trouble figuring out which contextual filter(s) and/or relationship(s) to use in order to display the main player with the 3 other players who have the same Grouping Code.

Any help would be greatly appreciated. I've been having issues with this for about 2 days and just can't figure it out.

Thanks in advance!

Comments

pixelsweatshop’s picture

It won't be a contextual filter, nor relationship. In Format: Unformatted list (or whatever your display is) select Settings and choose your grouping field

joshuahinman’s picture

Ok, that's definitely pointing me in the right direction as far as grouping the codes together. Thank you!

However, now I want only certain users to see their grouping code, not all of them. For example, User A is in grouping code CK-001. User B, User C, and User D are his competitors and they are all in CK-001, as well. How would I get it to where CK-001 displays ONLY for those 4 users instead of all users?

Another example that may be useful - User E, User F, User G, and User H are all in CK-002 and I want them to only see the competition entries (their competitors) from CK-002, so I wouldn't want them seeing entries and competitors from CK-001.

Could you give me some insight on what to do there, please?

Thanks!

pixelsweatshop’s picture

You're not going to get that using anything in views by default. You will most likely have to custom code something yourself. You might be able to do something with user roles as groups or taxonomy permissions but I don't know for sure.