expression engine: best way to handle user data, defined member fields or tie to a channel?
In expression engine:
I have a site that businesses can sign up and then sell 1 type of widget. Each business just needs name, widget and price. Then there will be a page that shows all business, with their widget and price.
What is the best way to handle the extra parameters 'widget' and 'price'?
From what I can work out there are two options
1/ Sign up the business as a user in a group with no admin privilages. Add the two custom member fields 'widget' and 'price' for the users. (It may not be called 'member' field, I'm going off my memory). To show these business I then grab the users.
or
2/ Sign up the business as a user in a group with no admin privilages. Add a one custom member field called 'id'. Then create a 'business' channel and to that chann开发者_如何学Pythonel add the custom fields 'name', 'widget', 'price', 'user_id'. Then link the instance of the business channel to the user with the 'id' property. When I want to show these business I grab the details from the channel.
Sorry if this is already answered somewhere. I'm not getting much luck from google, most likely because i'm having trouble phrasing my question succinctly enough.
Thanks
Dave
Dave,
If you're dead set on using users to organize these businesses, then your best bet would be the two custom fields. They're easier to use in templates and you don't have to worry about pulling in the channel data for the item in the custom member field 'id'. That being said, you should check out Solspace's User Module—it'll give you more flexibility with the member information.
Another thought, and depending on whether or not these businesses should be able to edit their widget and price, is you could just make it a channel and skip using users altogether. Using Freeform, you could create a form where businesses add that information, you get an email, and you add the information to the channel you want.
Wes
精彩评论