I need to create a custom search results page. I read a forum post stating that it should be created as a custom archive page and then assigned using conditions as the search results. I understand most of this, but how do I actually add the search results to the archive I have created? Is it via shortcode / looper? In an indeal worls I want to show products in what section and then posts in a seperate section underneath that
Hello @simonwr1976,
Thanks for writing to us.
I would suggest you go to your archive layout, which you have created for the search result page, and set this condition to assign the layout for the search result page.
Hope it helps
Thanks
That’s great, thanks. I’ve tweaked the search results page slightly to get it closer to how I want it. Underneath the title I want the product category to show, I’ve taken a guess at {{dc:post:category}} but it’s not working, please advise
On the current site there is an option for the user to do another search if they don’t like the search results (https://virginiasvintagehire.co.uk/?s=abraham+cart) how could I configure something like this?
We added a Looper Provider > Current Post Terms same as we did with the custom breadcrumbs. Adjust and configure the style as you wish.
Thanks again. another two things, sorry.
The categories are currently ordered sub category category, I want them to be ordered category sub category. Can you let me know how to change this, I don’t want to keep asking you the same thing. I couldn’t work out where / how you did it in the breadcrumbs.
I’d also like the category we have now added to be linked. I’ve copied the outer div from the breadcrumbs, but this doesn’t seem to be working as it should be
To display the categories , please do the following:
1.) Add a Div element, enable the Looper Provider > Current Post Terms > Product Categories, then turn on the Design > Flexbox option with Direction set to Row.
2.) Inside the first Div, we added another Div element, set the HTML Layout to < a > or link tag, then change the URL field value to {{ term.url }}. We also set this Div element as a Looper Consumer.
3.) Within the nested Div, we added a Text element, then set the dynamic content {{ term.name }}.
To reverse the order, we set the Design > Flexbox > Direction of the first Div element to Reverse.
Hope this helps.
this is really helpful thanks. I’ve followed your instructions and after a bit of playing around I’ve nearyly got it as I want it (but not quite).
Is there any way to have a space between category and sub-category. I’ve done a search for abraham cart and I get FURNITURE SCOTLANDCARTS.
Also the link on FURNITURE SCOTLANDCARTS is to the product and not to the category, is it possible to make it to the sub-category?
We adjusted the Design > Flexbox > Gap value to add space between the categories. To correct the link, we had to remove the URL value of the Post element and apply the product link to the title, product image and read more link. This should also correct the link of the product categories. Let us know if you need more info.
great, thank you for this