Skip Navigation

[Résolu] View results and search display twice

Ce fil est résolu. Voici une description du problème et la solution proposée.

Problem:
When I want to move the search form to another cell (sidebar), the result and search form display twice.

Solution:
View Cell normally works fine Layouts. If for some reason its not working, you can solve the problem, by inserting the view in the layout using a Visual Editor cell.

You can display Search form on one place and the results on another place on the same page. When you insert a Custom Search View into a page, it will give you option to separate form filters and results, and it will provide you with shortcode and instructions on how to add them separately, please follow the instructions given on screen.

Solution here: https://toolset.com/forums/topic/display-only-the-search-box-but-the-results-in-another-place-on-the-same-page/

Relevant Documentation:
https://toolset.com/documentation/user-guides/front-page-filters/

This support ticket is created Il y a 6 années et 8 mois. 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
- 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 -
- 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

Marqué : ,

This topic contains 8 réponses, has 2 voix.

Last updated by Eric De Paep Il y a 6 années et 8 mois.

Assisted by: Noman.

Auteur
Publications
#559925

Hi,

I created a view which displays perfectly when results and search forms are in the same cell but when I want to move the search form to another cell (sidebar), the result and search form display twice. The custom search setting of the view is set to display "only the search form" in the sidebar cell and "only the results" in the main content cell but this feature doesn't work. Ad a consequence, both results and search form display in the main content and again in the sidebar creating double content.

Thanks

#559989

Noman
Supporter

Languages: Anglais (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Eric,

Thank you for contacting Toolset support. You can display Search form on one place and the results on another place on the same page. When you insert a Custom Search View into a page, it will give you option to separate form filters and results, and it will provide you with shortcode and instructions on how to add them separately, please follow the instructions given on screen.

We have another client who had the similar issue and was also able to solve it: https://toolset.com/forums/topic/display-only-the-search-box-but-the-results-in-another-place-on-the-same-page/

I am not sure which cell type you are using at moment, but you can try Visual editor cell and for sidebar you can use “WP Views Filter” widget.

Alternate way is by using the [wpv-filter-meta-html] and [wpv-layout-meta-html] shortcodes as explain here (section: 4. Displaying the custom search):
https://toolset.com/documentation/user-guides/front-page-filters/

Thank you

#560046

Hi Noman,

I managed to solve the problem by inserting the view in the layout using a Visual Editor cell. But it doesn't work when I insert a view cell. The display settings (display "only the search form" or "only the results") have no effect. Removing the [wpv-filter-meta-html] doesn't work either. There must be something wrong there.

By the way, if I add a different custom search on my home page, do I have to display the results on another page or can I display them on the same results page?

In other words, considering that I inserted a view with a detailed search on my car listing page, can I add a smaller search form on my home page and display the results of this search on my car listing page? Or do I have to create another page to show the results for this small search form?

Thanks!

#560077

Noman
Supporter

Languages: Anglais (English )

Timezone: Asia/Karachi (GMT+05:00)

Hello Eric,

Great to hear that you have solved the issue, I will also check this with View Cell in Layout at my local site and if found any issue then I would be reporting it as a bug.

If I add a different custom search on my home page, do I have to display the results on another page or can I display them on the same results page?
>> It depends on you where you want to display the results, described in the doc I have sent you in last message, and here is screenshot as well:
hidden link

Thank you

#560115

Hi Noman,

Yes I tried that (like shown in the screenshot) but what I meant is: can you have 2 different searches linked to the same results view? Ideally, if people use the home page search or if they use the search on the car listing page, they would in both cases have the results on the car listing page (and not in 2 different cells).

Thanks.

#560120

Noman
Supporter

Languages: Anglais (English )

Timezone: Asia/Karachi (GMT+05:00)

Yes, that should work fine. I once tested a similar setup where I added first filters on a page and another filters in the sidebar of another page and both leads to the same Results page. So please give it a try.

Thanks

#560996

Hi Noman,

I gave it a try. Indeed, you can have filters on different pages that lead to the same results page BUT apparently you have to use the same view and insert the shortcode with the visual builder:


[wpv-form-view name="car-listing-view" target_id="9429"]
</cope>

The only way to modify the search form in this case, would be to use css to hide some fields and change the format.

Moreover, when you use a sorting control in your view, it bugs and returns a blank page.

I also tried it with 2 different views (to have different filters) but that doesn't seem to work because I can't see any way to link the second search view with the first results view. You have to use 2 different shortcodes, one for each view, which will display the results twice.

Thanks

PS: I really think there's a bug with the view cell. The settings to display only the search form or only the results don't work.

#561191

Noman
Supporter

Languages: Anglais (English )

Timezone: Asia/Karachi (GMT+05:00)

Hello Eric,

I suggest you to create different pages to show different View Results, this is the recommended way. If we put two Views results on the same Results page, it won’t work correct and it is not expected to work based on how this feature works currently.

I really think there's a bug with the view cell. The settings to display only the search form or only the results don't work.
>> I am not able to reproduce this issue at my end, View cell is working fine when display search form or only the results. I think you might have solved this using Visual editor cell and shortcode, by creating separate pages for each View result, the problem would get resolved.

When you use a sorting control in your view, it bugs and returns a blank page.
>> Please kindly open a new ticket for this second problem if you need help with this. This will help other users with similar problems to find solutions when searching the forum, I am not allowed to handle multiple issues in the same ticket as per support policy. https://toolset.com/toolset-support-policy/

Thank you

#561298

Hi Noman,

Ok, I will follow your suggestion and create different pages to show different View Results.

Thanks

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.