Skip Navigation

[Resolved] Problem creating Profile post using Conditional to display new post Form

This thread is resolved. Here is a description of the problem and solution.

Problem: I am using a custom post type Profiles to create custom Profile posts for Users. I have a Form that is used to create these posts on the front-end of the site. I have a page where I would like to display the Form if no Profile post has been created yet. If the Profile has already been created, I would like to hide the Form on the page. I also have another page where I would like to display a link to the page containing the Form. That link should also be hidden if the Profile post has already been created. This tutorial shows how to achieve this in the legacy Views editor, but not in the Blocks editor:
https://toolset.com/documentation/legacy-features/views-plugin/how-to-create-custom-searches-and-relationships-for-users/#how-do-i-prevent-users-from-creating-more-than-one-contractor-post

Solution: Use the "No items found text" editor in the Loop Template configurations of the View Loop block to insert the Form or link using a shortcode, or insert a Blocks-designed Content Template containing the Form or link using a shortcode.

Relevant Documentation:
https://toolset.com/documentation/legacy-features/views-plugin/how-to-create-custom-searches-and-relationships-for-users/#how-do-i-prevent-users-from-creating-more-than-one-contractor-post
https://toolset.com/documentation/programmer-reference/forms/cred-shortcodes/#cred_form
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-post-link
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-post-body

This support ticket is created 4 years 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.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 1 reply, has 1 voice.

Last updated by ibrahimM 4 years ago.

Assisted by: Christian Cox.

Author
Posts
#1855331

I'm having a problem displaying a new Profile Post Form when a conditional block is used to display the Form conditionally. If a Profile post has already been created by the User, I do not want to display the Form. If no Profile has been created yet, I want to display the Form. The tutorial here shows how to achieve this in the legacy Views editor, but I am using Blocks to create the View.
https://toolset.com/documentation/legacy-features/views-plugin/how-to-create-custom-searches-and-relationships-for-users/#how-do-i-prevent-users-from-creating-more-than-one-contractor-post

#1855559

My issue is resolved now. Thank you!