Skip Navigation

[Resolved] Creating custom profile page (view only)

This support ticket is created 4 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Our next available supporter will start replying to tickets in about 1.12 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

Author
Posts
#1589333

I'm hoping to have a profile page for users that has a custom layout (can build out with the Toolset tools). Ideally where if the logged in user views their page, they get a bit more info (in particular going to show posts they've bookmarked), but if a non-logged in user, or a different user views the page, they get similar info but not seeing the bookmarked (and maybe other stuff).

Is there a good way to do this? If we need two different pages, can do that if needed but would prefer one page that can serve both.

#1589719

Hi,

Thank you for contacting us and I'd be happy to assist.

If you're looking to create a unique profile page for each of your users, you can register a custom post type "User Profiles" and make sure that every user submits a form to create exactly one post in this post type, after registering.
( that post's single page will serve as each user's profile page )

This approach is explained in detail here:
https://toolset.com/documentation/post-relationships/how-to-create-custom-searches-and-relationships-for-users/

As for the content on that profile page, I understand, you'd like part of it shown only to the user whose profile page is being viewed.
( hiding it from non-logged in visitors as well as from other logged-in users )

This can be easily achieved through the conditional display feature:
https://toolset.com/documentation/user-guides/views/conditional-html-output-in-views/

For example:


[wpv-conditional if="( '[wpv-user field='ID']' eq '[wpv-post-author format='meta' meta='ID']' )"] 

The visitor is the author

[/wpv-conditional]

The above code block when placed inside a template for a single profile post page, will only show "The visitor is the author" content when the ID of the currently logged-in user ( [wpv-user field='ID'] ) and the ID of the post author of the current user profile ( [wpv-post-author format='meta' meta='ID'] ) are equal, which means they are the same person.

You can read more about these and other available shortcodes from:
https://toolset.com/documentation/user-guides/views/views-shortcodes/#wpv-user
https://toolset.com/documentation/user-guides/views/views-shortcodes/#wpv-post-author

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar

#1589761

My issue is resolved now. Thank you!

#1590505

Well I'm getting closer, but I can't seem to get to the conditional code area. I'm not using the views plugin but using the blocks one (messaging when installing seemed to not want me to have both). Do I need to use views? Or where do I go in blocks to get this logic?

Also, it looks like I'm going to need to create a custom filter and that would get applied to the view contents (need to query a list of post ids that are stored in a user meta field). Possible? Any tips?

Thanks again for your help

#1590553

I found the conditional block and got that working. So let me know if I need to open a new ticket but just want to see if it's possible to have the View block use a shortcode to get the items to loop through/filter (will have to build out the short code function but I can figure that out)