Navigation überspringen

[Gelöst] Default search value in view

This support ticket is created vor 5 Jahren, 1 Monat. 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 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Dieses Thema enthält 4 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von tobiasF-3 vor 5 Jahren, 1 Monat.

Assistiert von: Shane.

Author
Artikel
#1380265

I am trying to set a default search value on a page with a view. There are almost 1000 items loading in the view otherwise and I would like to set a default search value for when the page loads so only a few entries show up. Alternatively we could also only show the filter and search options and only when the user filters the view or searches for a term then the view lists the relevant items for the first time.

I didn't find any information on this googling for it.

versteckter Link

#1380291

Shane
Supporter

Sprachen: Englisch (English )

Zeitzone: America/Jamaica (GMT-05:00)

Hi Tobias,

Thank you for getting in touch.

I would suggest that your proceed with having the search filters on a separate page and the results on a another.

This can be done when you are adding the view to the page, you will be presented with 3 options, Both search and results, Search only and results only.

All you need to do is to add the search only to on page and it will ask you what is the results page. From there you can add the results page.

Please let me know what you think of this.

Thanks,
Shane

#1380427

Thx Shane. This works fine for now. But I could see scenarios where it would be nice to define a default search in the filters. But it sounds like there is no easy/standard way to do this?

#1381075

Shane
Supporter

Sprachen: Englisch (English )

Zeitzone: America/Jamaica (GMT-05:00)

Hi Tobias,

Yes there is actually not an easy way to do this to have a default search filter, unless you will be using javascript to set the filter value each time the user loads the page and then perform the search after the page has been loaded.

Another way is that you can provide the default value as a URL parameter, however this means that the search would be clicked to from a specific link from that url parameter.

Thanks,
Shane

#1381229

Thx Shane, I will continue with the current solution and let you know if I have any more questions. My issue is resolved now. Thank you!