Skip Navigation

[Resuelto] Changing the default search archive using Toolset

This support ticket is created hace 4 años, 11 meses. 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.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

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)

Este tema contiene 7 respuestas, tiene 2 mensajes.

Última actualización por Zayne hace 4 años, 10 meses.

Asistido por: Shane.

Autor
Mensajes
#1436725
Screenshot 2020-01-02 at 23.22.08.png

I'm using Relevanssi to enhance the default WP search. However, the results are ugly when they are returned. I see in this forum post (https://toolset.com/forums/topic/custom-search-results-page-using-toolset/) that there is a way to change the search archive. I've managed to create an archive, but I can't figure out how to limit the results, as I'm using GeneratePress's Navigation Search option, which adds a Navigation Bar to the Menu. I can't see how to customise this search to add any filters as described here: (https://toolset.com/documentation/user-guides/views/filtering-views-for-a-specific-text-string-search/)

Is there a way to do this? If not, is there a way to create a Toolset search form that I can embed in the main menu?

#1436863

Shane
Supporter

Idiomas: Inglés (English )

Zona horaria: America/Jamaica (GMT-05:00)

Screenshot 2020-01-02 at 4.05.24 PM.png

Hi Zayne,

Thank you for getting in touch.

You can actually do this by creating a new archive and selecting the search archive. See Screenshot

So you would go to Toolset -> WordPress Archives and hit add new and then select Search Results.

This will then take you to the editor where you can customize your search results.

Given that this is the search results archive you wouldn't need to create a custom archive for each.

Please let me know if this helps.
Thanks,
Shane

#1436875

Shane
Supporter

Idiomas: Inglés (English )

Zona horaria: America/Jamaica (GMT-05:00)

Hi Zayne,

When you say limit the search results are you referring to limiting the number of items being displayed per page ?

Also are you using the block editor to customize the archive ?

If so please let me know so I can best advise you on this one.

Thanks,
Shane

#1437427

Hi Shane

No, I don't necessarily want to limit the number of items returned. What I"m trying to do is take the results from relevanssi and display them using the custom layout.

This is the functionality that I'm looking for: I have a site that shows the works of a composer. There are also recordings of these works and other material related to these works. I want a single search text box in the main menu that allows me to type in some search text and then to be shown the results grouped according to Custom Post Type, i.e. all the works first, then all the recordings, then the other material.

I'm using GeneratePress as my theme. GeneratePress offers the ability to have a search bar on the main menu that performs a standard WordPress text search. That was my screenshot in the first message.

I'm using Relevanssi to allow the WordPress search to be enhanced by searching through my custom fields.

The search functionality from point 1 above returns results from a number of different custom types (works, composers, recordings, etc) that are formatted really badly. I want to format these results to look better.

4) When I'm creating a custom search archive, I can't figure out how I pass the search criteria from the main menu search text box through to the View as a parameter so that I can filter accordingly.

I hope this makes my situation clearer.

#1438065

Shane
Supporter

Idiomas: Inglés (English )

Zona horaria: America/Jamaica (GMT-05:00)

Hi Zayne,

Ok I believe I understand now.

"What I"m trying to do is take the results from relevanssi and display them using the custom layout."

From your screenshot i'm assuming that you've already created your custom search archive for the search results. If you have not yet done this you will need to go to Toolset > WordPress Archives and create a new archive and set it to the search results. This should allow you to customize how your search results are displayed.

"4) When I'm creating a custom search archive, I can't figure out how I pass the search criteria from the main menu search text box through to the View as a parameter so that I can filter accordingly."

Given that you are creating a custom wordpress archive for the search results archive page you won't need to add any search information to the custom archive you are creating. This is because once the search is done from your header it will link to your custom archive.

This will mean the results will be filtered and displayed in the format that you have defined in your custom archive. If this is not what is happening for you please let me know.

Also you can allow me to check what you've done so far to see if there is anything missing by providing me with admin access to the website.

The private fields have been enabled for your next response.

Thanks,
Shane

#1439439
Screenshot 2020-01-04 at 11.41.41.png

Hi Shane

I've now created a custom WordPress Archive as you described in your previous message and it works.

I see now that I had created the Search Archive layout a different way. I didn't see the Toolset > WordPress Archives menu item, so I went Toolset -> Dashboard, chose a CPT archive that wasn't already created and created it. Then, in the new archive layout, I unassigned it from the CPT and assigned it to search (see attached). This method doesn't seem to work - it creates a Layout and not a View, like what happens when you create a custom WordPress Archive from Toolset -> WordPress Archives. This is really confusing though. What is the point of being able to assign a layout to the Search Results when it doesn't actually work?

#1442723

Shane
Supporter

Idiomas: Inglés (English )

Zona horaria: America/Jamaica (GMT-05:00)

Hi Zayne,

I suspect the problem here could be that when you've assigned a Layout to the Search Results archive, you didn't add an archive cell to the layout.

The layout won't work without the archive cell. If this is what happened then you can try adding an archive cell to your layout so that it can display your results.

Please let me know if this helps.
Thanks,
Shane

#1448033

Thanks Shane. All sorted now.