Displaying only content assigned to member

2 posts by 1 authors in: Forums > CMS Builder
Last Post: May 21, 2018   (RSS)

Hi all!

I'm working on a site for a church who wants a member page that will display content specific to the department(s) that member belongs to.  So, for instance, if the member works in the Children's Ministry, their member page will show only content designated for those working in the Children's Ministry. However, if a member works in both the Children's Ministry and the Music Ministry, they will see content designated for both the Children's and Music Ministries on their member page.

I am using the membership plugin to allow members to signup and manage their accounts. That is all working beautifully. What I am stuck on is how to display content specific to each member.

In CMSB, I have all members listed in the "User Accounts" section. Then, I have a multi-section called "User Categories". This section a display "title" and "database_name" along with associated content for each respective ministry/department. In the User Accounts section, I created a multi-value checkbox list called "user_category". Here, admins can assign the member to a category (i.e. ministry department) by checking the box or boxes corresponding to the content that member should be able to view (ex: checking the "Children's Ministry" box allows that member to view "Children's Ministry" content).

Right now, using the traditional "foreach" loop, every member sees the content for every department.  I just need to know how to limit the content displayed on the page to only what that member is allowed to see based on their department designation in User Accounts.

I'm assuming a "where" clause would handle this, but everything I've tried so far hasn't worked. I'd really appreciate any insight.  :-)

Thanks in advance,
Jeremy

---------------------------

Dwelling Productions

www.dwellingproductions.com