Skip Navigation

[Resolved] Creating Custom Post Type Via Toolset Post Forms, Views Loop = No Items Found

This support ticket is created 5 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
- 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)

This topic contains 5 replies, has 2 voices.

Last updated by Waqar 5 years, 7 months ago.

Assisted by: Waqar.

Author
Posts
#1285743
03-public-visible-custom-post-type-listing-created-via-toolset-post-forms.jpg
02-toolset-post-form-for-wordpress-user.jpg
01-custom-post-type-listing-created-via-toolset-post-forms.jpg
04-custom-post-type-listing-created-via-WP-admin-area-works-as-expected.jpg

I am trying to: Create a custom post type called Listings via a Toolset Post Form called Create Offering (ID: 6190). The post creation works, but when I retrieve the data using a View it returns "No items found". If I create the custom post type Listings via the WordPress admin area the Views do return data.

Link to a page where the issue can be seen: hidden link

I expected to see: The same behavior when I create posts via Toolset Post Forms as when I create posts via the WordPress Admin. Views should work on the Listings page because they both pull data from the exact same custom post type and fields. This is a listing that was created in the WP admin area hidden link

Instead, I get: No items found for all my views.

NOTE: to access the site which resides behind the plugin Hide My Site use password: fon
NOTE: to access the site which resides behind the plugin Hide My Site use password: fon
NOTE: to access the site which resides behind the plugin Hide My Site use password: fon
NOTE: to access the site which resides behind the plugin Hide My Site use password: fon

#1285787

Appears to be a related issue here with post forms. This Create Offering (ID: 6190) toolset post form has multiple repeating field groups, so I attempted to create a form for one of them: Management Bio Creation Form. When I add this form to a page and link to it from the Issuer Profile hidden link when I visit that page from the logged in user the page is blank hidden link

On that form there is a field called Listing which was created by default, which I think is the ability to link it to the parent listing post. On the Create Offering form there is a Listing Parent field which was created by default.

Create An Issuer Profile To Replicate My Steps
In my website I am creating a directory of Listings/Offerings/Deals (same thing). An issuer of the listings/offerings/deals is the author of a listing. The author may only create one listing (but I haven't limited them yet). To create the author profile I simply have them go through an Issuer Registration page at hidden link

That form creates a user inside of WordPress with an Issuer role assigned to them. That is as far as I am taking the author role, which may be my problem. In your example at https://toolset.com/documentation/post-relationships/how-to-create-custom-searches-and-relationships-for-users/ you extend the default WordPress user to a custom post type called Contractor. Then the contractor is able to create posts using your toolset post forms. Is that the root of my issue, that I am not extending the default WordPress user into a Custom Post Type and using that as the parent for the forms?

#1285793

OK so the Management Bio form wasn't appearing because I did not give it Access in the Toolset Access control area. Once I did I was able to add the Management Bio to the listing.

THIS ACTION made the other Views work. So now the Contact Us area displays data. Before this it did not display data. Why is that?

Can you create a new issuer profile and create a listing in the issuer profile, then view it either by clicking on the listing title in the Issuer Profile or by going to the View Listings and clicking on it hidden link

Why won't the Contact Us view appear until I create a management bio?

#1286349

Hi Andrew,

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

1. Your "Create Offering" form is set to add new posts with "Pending Review" status and not "Published".
( screenshot: hidden link )

Whereas a post view only shows published posts by default, unless a query filter specifically exists to show posts with a different status too.

This is the reason why posts which are added through this post form are not shown in your view(s).

2. Glad that you've managed to fix the issue with the "Management Bio" form through the access settings and you'll find details on the topic, in this guide:
https://toolset.com/documentation/user-guides/access-control-for-cred-forms/

3. The results from Contact Us view, do not appear until a management bio has been added, because of the current "Query Filter" settings in the "Contact Us Social Media Icons" view.

"Select posts in Any relationship that are related to the Post where this View is shown."
( screenshot: hidden link )

Until a child post "Management Bio" exists for a parent listing post, no results are displayed. You can remove this query filter and only set a "Post ID" filter, to make sure that this view brings in only the information for the listing, whose single detail page is being viewed.
( screenshot: hidden link )

Next, you can update your view's shortcode, to include the current post's ID through shortcode "[wpv-post-id]", as a shortcode attribute "post_ids", like this:
( ref: https://toolset.com/documentation/user-guides/passing-arguments-to-views/ )


[wpv-view name="contact-us-social-media-icons" post_ids="[wpv-post-id]"]

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

For a new question/concern, please open a new ticket.

regards,
Waqar

#1286475

Hello,

1. "Whereas a post view only shows published posts by default, unless a query filter specifically exists to show posts with a different status too." How do I do this?

#1287031

Hi Andrew,

Thanks for writing back.

You'll find an option to filters posts based on the "Post Status" in the "Query Filter" section, as shown in this screenshot:
hidden link

regards,
Waqar