Passer la navigation

[Résolu] Conditional display if view not empty

This support ticket is created Il y a 3 years, 8 months. 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.

Ce sujet contient 2 réponses, a 2 voix.

Dernière mise à jour par aurelieL Il y a 3 years, 8 months.

Auteur
Publications
#2484057

Tell us what you are trying to do?

I'm trying to display related posts in a view, but I want to hide the view if it is empty.

Is there any documentation that you are following?

This support ticket appears to have the answer I'm looking for, but the specific configuration of the conditional block is behind a hidden link.

https://toolset.com/forums/topic/conditional-display-of-a-view-if-it-is-not-empty/

What is the link to your site?

lien caché

#2484467

Nigel
Supporter

Les langues: Anglais (English ) Espagnol (Español )

Fuseau horaire: Europe/London (GMT+01:00)

Hi there

I edited the links in the thread you shared so that the screenshots in this reply are visible: https://toolset.com/forums/topic/conditional-display-of-a-view-if-it-is-not-empty/#post-2330179

You are doing something similar to what is described in this documentation, to not show the output of a custom search View when it first loads until something has been searched for: https://toolset.com/course-lesson/creating-a-custom-search/#hide-the-search-results-until-the-first-search

But in your case where you are not using custom search you want to use the condition described by Minesh in that support thread, checking the number of results, which you can enter as shown in his screenshots through the normal UI.

#2484685

Your solution works great Nigel, thank you!