Support Forum
Support › MB User Meta › Membership DirectoryResolved
I'm a little confused about which direction to go with creating a membership directory.
1) Buy a plugin such as Posts Table Pro?
or
2) do it with Metabox & write my own plugin. If I do it with Metabox, which extensions would be involved?
Use case: I'm developing a website for a business association. They have 2 types of members: dealers & sales people. Sales people and dealers are related in that all sales people work for a dealer (& only 1 dealer); each dealer employs 1 or more salespeople.
I have a list of dealers & salespeople with basic info. Name, phone #, address. I will load this data from csv tables. Then I'd like dealers & salespeople to be able to log in & add additional data, such as image, website, etc.
Do I set up 2 custom post types? 1 for dealers & 1 for salespeople & connect them using MB Relationships?
Or do I make everyone a WP user & add custom fields to Users with the User Meta extension?
I'd like to be able to display sales people in 2 ways:
a) by last name alphabetically &
2) by the dealer they work for.
Re coding this all myself or buying an off-the-shelf plugin like Posts Table Pro.
On one hand, as a programmer, I can appreciate having complete control & flexibility.
On the other, I don't want to be ridiculous & re-invent the wheel for no reason.
Any advice?
Thanks
James
Hi James,
I've not used Posts Table Pro, so I can't say about it. But you can do it with Meta Box plugins.
Do I set up 2 custom post types? 1 for dealers & 1 for salespeople & connect them using MB Relationships? Or do I make everyone a WP user & add custom fields to Users with the User Meta extension?
This is a great question and I think the most important question, no matter you choose to do it by your own or use Posts Table Pro plugin.
I'll list the pros and cons of each method and you can choose one (just note that both methods work!):
Using post types:
- Pros: You can benefit from WP template system (e.g. archive page, single page)
- Cons: There's no login for post types. So you still need to create a post for each user and connect it with the user. You can use MB Relationships for that purpose or just use post_author
attribute from WP.
Using user profile:
- Pros: No need to create a post type for users and no need to connect that post type with user.
- Cons: You have to work on the template by your own (querying all (one) users and display their info).
In long term, I think the 2nd method is better since the data is more simpler to understand. The template issue is not a big problem, I guess.
Ahn Tran, thanks for the reply on this post. I am looking at this as well. We have a neighborhood website for the residents and we wish to publish a directory of users. The only rules for this is that we need to give each resident the ability to opt out of the directory if they don't want their information published. Also we need to have this be only available to logged in residents and not open to the public. It would be great to have a tutorial on something like this or even a plugin (which I would be willing to purchase) that can do such things. I think user directories are a big think for organizations and think you could make some more revenue for this. Think about it:) I'm just jumping into metabox, so setting up something like this will take a while as I'm learning more about Metabox.
Hi rstark,
Thanks for your comment. I think you can query users using the get_users()
function. For each user in the loop, get his information via rwmb_meta() helper function (for custom fields).
I've just made a note on creating tutorial 😉