Support

Account

Home Forums Add-ons Repeater Field User Groups/Use Case

Unread

User Groups/Use Case

  • Interesting use case here and I need some help from people much smarter than I.

    I have set up 2 CPT’s, 1 CPT is called Market Groups that has a repeater (market_group) with 2 sub_fields:
    Market (market, type: Text) – Will be used to group users by City name
    Member (member, type: User)

    The other CPT is called Music and has a repeater (market_claim) with 4 sub_fields:
    Market(market, type: Post Object) – Pulling in the Market Groups CPT
    By Member(user, type: User)
    Client(client, type: Text)
    Date Claimed(date_claimed, type: Date Picker)

    When adding new users, I want to “group” them into one of the Market Groups CPT (city name based, Dallas, Miami, Denver, etc). Then, when someone wants to claim one of the posts in the Music CPT, go in and edit that Music post, choose what Market (city), the Member of that Market who claimed the post, the Client name, and the date that it was claimed.

    Here is the kicker, in the archive-template code, I need to loop through each post and check a couple different things. 1: If that Music post has any market_claim rows, if so get the market sub_field(s). 2. Is the logged-in user a member of that market group? If both are true, display the post with *this* information, if false, display the post with *that* information.

    It’s kind of like a “per post” membership idea, where once the post is “claimed” by anyone in Dallas for example, each person who is a member of the Dallas group can see who claimed the post, the client name, and the date it was claimed by that member. Anyone outside of the Dallas group doesn’t see any of that information.

    I’ve been trying to work this out for days to find the best way to do this but can’t seem to wrap my head around it. Is this setup the best way to accomplish this?

Viewing 1 post (of 1 total)

The topic ‘User Groups/Use Case’ is closed to new replies.