Skip Navigation

[Resolved] I need advice on how to setup a user directory

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 7 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 10 replies, has 2 voices.

Last updated by Jim 7 years, 11 months ago.

Assisted by: Nigel.

Author
Posts
#459785

Jim

I am trying to build a website with user profiles. Kind of like a directory.

I want the visitors to be able to search profiles based on name, city (taxonomy), skills (taxonomy), and rating (not sure how to includes ratings yet).

Now I wonder if I should build a complete new post type for this or use user fields to expand user profiles.

I was thinking that using a new post type for this gives more flexibility, but on the other hand I think that expanding profiles is more logical.

Do any of you know if using user profiles for this limits the possibilities and that is is correct that custom post type is more flexible?

Or am I wrong and should I go with expanding user profiles for this?

Thanks in advance
Jim

#459819

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Screen Shot 2016-11-23 at 13.14.44.png

Hi Jim

Please see the screenshot for your answer.

You are right that logically you would do this by expanding user profiles, but you are also right that creating a custom post type for users gives you more flexibility.

If I were coding this without Toolset (or only using Types) I would probably go with expanded user profiles.

But, currently, you can only have Views custom searches, for example, for posts, not for users, so you wouldn't be able to display users with filters for any of the user fields.

(And taxonomies work with posts, not users, so I would maybe want to rethink how I would do it without Toolset in any case.)

#459831

Jim

Nigel, Thanks for your reply!

So, a custom post type is the way to go because user profiles cannot be made searchable (with filters) and they cannot hold taxonomies, right?

So a custom post type is the way to go!?
Do you see any problem using post type with what I want to accomplish?
Is using toolset for my website the right tool??

Now I know that I should not use the users profile, the only disadvantage I see is how to get this custom (profile) type, hooked to a user, and prevent them from making more than one.

Any (other) ideas

Thanks!!
JIm

#459868

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Jim

I don't see that you will have problems using custom post types for the "user" profiles, it just means doing things a little differently.

We have some useful tutorials such as for a membership site that I think would be beneficial to you: https://toolset.com/learn/create-membership-site-wordpress-using-toolset-plugins/

The thing is, because they don't feature, for example, searching users, they just use user profiles.

And custom search for users is on our roadmap, I just don't have a timetable for when it is likely to be added.

The only real obstacle to going down the users-as-posts route is during account creation.

You can use a CRED user form for new users to register. Even with users-as-posts your users will still need an account and a user profile.

But when the account is created with the minimum required user fields you will then want to create the corresponding user-posts. You can do it in two steps - a user form to register, and a post form to "complete your profile". Or you could use the CRED API and some custom code so that the user completes their profile on the registration form and behind the scenes when the form is submitted the corresponding user-post with the user as post-author is created with its custom fields populated so that to the user it appears as a single step.

Once you have cleared that hurdle the rest is pretty much plain vanilla.

#459881

Jim

I get where you are going Nigel.
Thanks, I think this might work out!

The only thing I am worried about is "rating and reviews" for the profiles.

I did some searches on the toolset forum and the 'solutions' I found are not very promising.

Can you take my worry away by saying that this no longer is a problem for a types custom post type?

You can imagine that for a user directory listing, user ratings and reviews are very important, also to sort, order and filter by ratings...

Hope to hear your thoughts on this.
And thanks for your help so far!

#459898

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Is there something specific about reviews/ratings you are concerned about?

Because if you go do the users-as-posts route then these are just custom fields on the posts and can be displayed and filtered just like any other.

#459922

Jim

So you are saying that it can be easily achieved Nigel?
Can you advice me a review/rating plugin that works good with toolset views then?

#460073

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

I would hesitate to say anything is easy because it very much depends on your level of experience and own abilities. Toolset lets you create sites without PHP coding but you still need to grasp the underlying WordPress concepts.

I had understood you to mean you wanted to create a review/ratings system for the users. But if you are talking about using a plugin (I'm not familiar with any) then I can see that this would potentially create issues, because they will be designed to work with user profiles and not with users-as-posts. Without studying how such plugins work I couldn't comment on how easy it would be to bridge that.

#460078

Jim

So, if you had to develop this what would you use/do to get a review and rating system in place?

#460207

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Say you were rating my profile (where that was actually a post).

Presumably this would work such that various other users could rate me, and when people viewed my profile they would see the average rating.

There are two ways you might go about that. A more disposable way would be to keep a running average which is stored as a custom field. You would actually need at least two fields. One would have the current average rating, the other would have the number of ratings given. So if my average rating were 3.21 from 37 ratings, then when the next user came along and rated me at 4, the new field values would be updated to 3.23 and 38. You are not going to be able to do something like this without the odd snippet of custom code to do such calculations for you.

The second way would involve you retaining all the ratings the user x gave user y and calculating the average on the fly when required. That may be overkill, but involves the same methodology as you will require for reviews (where you surely will want to record what review was given by user x for user y).

To do that you would make a custom post type for the ratings, and use post relationships to link the review post to the review subject (who the review is about). (The poster of the review would just be the post author of the review.) So you are looking at a parent-child relationship, as described here: https://toolset.com/documentation/user-guides/creating-post-type-relationships/

Note, though, that post relationships will get a major overhaul with the next Types update, due, hopefully, in a matter of weeks, and you would be well advised to work on other parts of your site that don't rely them on the meantime. Although existing sites will be transitioned to work as before, it may be that you think differently about how to set them up in the first place.

You can read a little more about that here, though I don't have any more details for now: https://toolset.com/2016/08/how-post-relationship-replaces-post-reference-and-repeating-fields/

#461061

Jim

Thanks for your detailed reply Nigel!

The forum ‘Types Community Support’ is closed to new topics and replies.