Skip Navigation

[Resolved] How to display a Toolset Form only when a View returns no results in Toolset Blo

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 2 replies, has 1 voice.

Last updated by - 2 days, 3 hours ago.

Assisted by: Minesh.

Author
Posts
#2922134
screen3.jpg
screen2.jpg
screen1.jpg

Dear support team,

I am rebuilding and studying the workflow described in Toolset's tutorial “How to Create Custom Searches and Relationships for Users in WordPress.”

My environment is:

WordPress
Toolset Types 3.6.5
Toolset Blocks 1.6.31
Toolset Forms 2.6.28
Toolset Access 2.9.8

I have two custom post types:

Specialists
Works

Each Specialist and its Works use the same WordPress Post Author to associate the content with the WordPress user.

I have successfully reproduced these two View filters:

Post author is the author of the page where this View is shown

This successfully displays only the Works belonging to the author of the currently displayed Specialist.

Post author is the same as the logged in user

This successfully displays only the Works belonging to the currently logged-in user.

I am now trying to reproduce the tutorial's method for allowing only one Specialist profile per WordPress user.

I created a View named:

Specialist by Logged-in User

The View selects:

Specialists

with the filter:

Post author is the same as the current logged in user

The logic I want is:

If the View finds a Specialist belonging to the logged-in user: display nothing.
If the View finds no Specialist: display my existing Create Specialist Toolset Form.

In the older tutorial, this appears to be implemented by placing the Create Specialist Form in the View's “No Items Found” output.

However, in Toolset Blocks 1.6.31 I can see the message:

There were no posts found to display for this View's query.

but I cannot find an editable “No Items Found” section/block where I can insert the Toolset Form.

In the block list I can only see:

View → View Output → View Loop

I have also checked:

View Output
Layout Customization
Add Other Blocks
Toolset Conditional block

The Conditional block offers Post data, Static value, Views Shortcode, Custom Shortcode, Custom function, Current user ID, Current user role, etc., but I cannot see a direct “View has no results” condition.

What is the recommended current method in Toolset Blocks 1.6.31 to reproduce the tutorial's original behavior?

Specifically, how can I display the Create Specialist Toolset Form only when the logged-in user has no Specialist post?

If the original “No Items Found” technique is no longer available in the Blocks UI, what is the recommended replacement without custom PHP?

Thank you,

Yoshihiko Hirai

#2922214

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

What you can do is:
click on the "View loop" on left sidebar and then on right side bar click on the tab "Loop Template" and you will see the following with the associated box:

[wpml-string context="wpv-views"]No items found[/wpml-string]

Replace the above with the form shortcode that display the desired form you want. For example:

[cred_form form="replace-with-your-form-slug"]
#2922242

Hello, Minesh.

Thank you for your support.
I was able to complete the intended experiment smoothly.
I am very grateful.

Yoshhiko Hirai