Skip Navigation

[Resolved] Displaying the proper form for a user cred submission

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.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 1 reply, has 2 voices.

Last updated by Minesh 4 years, 7 months ago.

Assisted by: Minesh.

Author
Posts
#1606555

Tell us what you are trying to do?

My site is very dependent on user post submissions, where a user can submit a child post for a parent on the parent page. I would like to restrict a user from submitting more than one child post, so rather than have the form be displayed for them to submit again, I would like to have a message be displayed saying something like "It looks like you've added submitted a "post", you can edit your post below" and have the edit post form be displayed.

I can easily achieve this step using views and creating a view for the child post in the relationship and filter it by current post author and within the view have the form to edit the post be there. That's no problem, the issue I'm having is that I don't want the form to be displayed for them to submit additional child posts.

Essentially I just want the add child post form to be displayed conditionally if the current user hasn't made any child posts for the parent that the form is displayed on.

Is there any documentation that you are following?

I've look through much of the documentation and I haven't found a solution

Is there a similar example that we can see?

I did see a similar case when searching through the forums but nothing that fits my needs entirely
What is the link to your site?

#1606831

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

What you said:
can easily achieve this step using views and creating a view for the child post in the relationship and filter it by current post author and within the view have the form to edit the post be there.
==>
But what if you creating a view for the child post in the relationship and filter it by current post author and limit this view to 1 item and then you can setup the Loop Editor section as follows:

[wpv-layout-start]
	[wpv-items-found]
         Add whatever text you want to display when a child posts is found.
	<!-- wpv-loop-start -->
	 
		<tbody class="wpv-loop js-wpv-loop">
		<wpv-loop>
			 
		</wpv-loop>
		 
	<!-- wpv-loop-end -->
	[/wpv-items-found]
	[wpv-no-items-found]
		  when there is no post found - you can add your form here 
	[/wpv-no-items-found]
[wpv-layout-end]

As you can see with the above Loop Editor code, you can add any text you want to display when post is found within the [wpv-items-found] section and you can add the form to [wpv-no-items-found] section when no post is found for that author.

Does this makes sense?