Skip Navigation

[Closed] I want to see empty results at the begining , before to aply filters

This support ticket is created 4 years, 9 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+01:00)

This topic contains 9 replies, has 2 voices.

Last updated by Nigel 4 years, 9 months ago.

Assisted by: Nigel.

Author
Posts
#1835343

I want to see empty results at the begining , before to apply filters.
When I see the view, it shows all results and I want to show only results if someone use filters.
Thanks

#1835455

I use this solution, but appears filters empty too:
https://toolset.com/forums/topic/setting-empty-search-result-by-the-default-page/

#1835573

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

That is no longer the recommended solution.

With Blocks you can try the solution described here: https://toolset.com/forums/topic/show-no-results-until-filtered/#post-1734109

#1835617

Thanks, I insert theses two sentences:

[wpv-conditional if="( '[wpv-search-term param='wpv_view_count']' ne '' )"]
[/wpv-conditional]

and it works at the beginning.

But If I clean filters, there are all the results another time.

#1835829

Hi Nigel, thanks for your answer. I will try to explain it in spanish.
He insertado el condicional que me has recomendado [wpv-conditional if="( '[wpv-search-term param='wpv_view_count']' ne '' )"]
[/wpv-conditional]
y funciona cuando entro por primera vez en la página. Pero si utilizo una vez el filtro, cuando lo quito, los resultados ya no quedan vacíos. Esta solución solo funciona cuando la página se acaba de cargar.
¿Hay alguna forma que los resultados queden vacíos siempre si no hay un filtro marcado? ¿No debería ser una opción básica de Toolset?
Thanks

#1836745

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

¿Puedes darme detalles de los filtros que usas en la vista?

Y ¿tienes un enlace que puedo usar para probar la búsqueda?

#1837213

Este es el enlace: hidden link

Filtro:
[wpv-filter-start hide="false"]
[wpv-filter-controls]
<div class="form-group">
<label for="wpv-wpcf-tipo-de-servicio">[wpml-string context="wpv-views"]SERVICIOS - PRODUCTOS[/wpml-string]</label>
[wpv-control-postmeta field="wpcf-tipo-de-servicio" format="%%NAME%%" url_param="wpv-wpcf-tipo-de-servicio"]
</div>
<br>
[wpv-filter-reset reset_label="Borrar filtros" output="bootstrap"][/wpv-filter-controls]
[wpv-filter-end]

Bucle:
[wpv-layout-start]
[wpv-items-found]
[wpv-conditional if="( '[wpv-search-term param='wpv_view_count']' ne '' )"]
<!-- wpv-loop-start -->
<table width="100%" class="wpv-loop js-wpv-loop">
<wpv-loop wrap="3" pad="true">
[wpv-item index=1]
<tr>
<td width="33%" valign=top>
[wpv-post-body view_template="loop-item-in-empresas"]
</td>
[wpv-item index=other]
<td width="33%" valign=top>
[wpv-post-body view_template="loop-item-in-empresas"]
</td>
[wpv-item index=3]
<td width="33%" valign=top>
[wpv-post-body view_template="loop-item-in-empresas"]
</td>
</tr>
[wpv-item index=pad]
<td></td>
[wpv-item index=pad-last]
<td></td>
</tr>
</wpv-loop>
</table>
<!-- wpv-loop-end -->
[/wpv-conditional]
[/wpv-items-found]
[wpv-no-items-found]
[wpml-string context="wpv-views"]Sin resultados. Utiliza los filtros para tu selección[/wpml-string]
[/wpv-no-items-found]
[wpv-layout-end]

#1838803

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Gracias.

En este caso puedes usar una prueba más específica como solo tienes un filtro, es decir debes reemplazar wpv_view_count así:

[wpv-conditional if="( '[wpv-search-term param='wpv_wpcf-tipo-de-servicio']' ne '' )"]
#1843167

Si substituyo
[wpv-search-term param='wpv_view_count']
por
[wpv-search-term param='wpv_wpcf-tipo-de-servicio']
en el editor de bucle,
deja de funcionar y no aparece ningún resultado

#1843683

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Funciona en mi sitio de prueba.

¿Puedo acceder al sitio tuyo para echar un vistazo?

Voy a marcar tu respuesta siguiente como privada para que me facilita acceso a tu sitio. Es una buena idea crear un nuevo usuario administrador para mi que lo quitas después, y asegúrate que tienes una copia de seguridad corriente.

The topic ‘[Closed] I want to see empty results at the begining , before to aply filters’ is closed to new replies.