Skip Navigation

[Resolved] How to make a Conditional Statement to display a relationship

This support ticket is created 5 years, 6 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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 5 replies, has 2 voices.

Last updated by michaelW-23 5 years, 5 months ago.

Assisted by: Christian Cox.

Author
Posts
#1246764
blank views taking up space.png

I have created many-to-many relationships and views to display them. I want to display the views if they exist on a template page (using Toolset Blocks). At the moment, the empty view divs are creating blank space on pages where there is no relationship. Is there an "IF" statement I can use?

And/or how can I stop WordPress from injecting <p> tags into Toolset Code in Toolset Block templates. I've tried using the "[noautop]" shortcode, but Gutenberg decides the block contains invalid html and tries to resolve it which results in a mess.

#1246778
views code.png

Here is the code of the view in the Toolset Blocks template

#1246802

Hi, just following up, it looks like you have used the "disable wrapping div around the View" option in this View's settings, am I right? If so, then can you delete everything between the no items found shortcodes, including all spaces and line breaks, like this:

[wpv-no-items-found][/wpv-no-items-found]

I'm not exactly sure why the paragraph tags are being inserted in your case if no items are found...are there conditionals in the loop hiding some items?

#1246809
autosave.png

OK I've just realised that on this occasion, the <P> tags and <br/> tags in my screenshot are part of a different view and were inserted by me. Apologies for the confusion.

Trying to edit this Toolset Blocks (Beta) template can get quite confusing because the Gutenberg editor seems to be trying to re-write the html in the Toolset Blocks and has definitely injected <p> tags in other "TB Files and Text" layout blocks.

In these templates, the autosave enters a never-ending loop, so it's difficult to save.

Having said all that, I do think TB has lots of potential and am looking forward to the first stable version.

New threads created by Christian Cox and linked to this one are listed below:

https://toolset.com/forums/topic/blocks-editor-autosave-is-stuck-loading/

#1247186

Okay no problem, I have split your autosave issue into a separate ticket since it's a bit different than the original reason this ticket was started. I'll follow up with you there shortly. Thanks!

#1248371

Thank you for answering my original question and opening a new thread for one of the other issues raised.