Layout builder - Search results advice

Hi folks,

Right i have used the layout builder to do a post page and a blog page now which is great. I have just moved onto looking at setting up a search results page but need some advice if possible. I have added a posts element and have got the look how i want it but i am unsure as to what to change so that the posts show search results instead of just showing posts. I may be way off mark with the posts element but though that that was a good starting point. Website is https://severndaleacademy.co.uk if you want to see what happens at the moment for a search.

thanks everyone,

kind regards,

Chris

Hello Chris,

Thanks for writing in!

If you want your current custom blog index layout (Posts Page layout) to be also the same layout for your search results, you can simply add a condition in your layout:

kindly let us know how it goes.

Hi @ruenel, i have that set on my search results layout but the content it pulls through is just post content. (not what you have searched for) Its probably because i have a posts element on my layout which is pulling post info but i don’t know how to tell it to pull the search results in. Shall i leave you a link etc to my site? I will add a secure note.

Hi Chris,

To pull the right content on your search result, you just need to disable the looper provider (turn it off) in your Search Result div.

Hope that helps.

Hope that helps.

Thanks @marc_a, thats done the trick! The only issue i am seeing and you will see in your screenshot is that it seems to add the category data before the excerpt. E.g if you look at your screenshot for example, under the result home, it says: LatestNewsNewsPost4 before the test and it does this on other items. Is there a way to not output that and only the text from the page/post? Thanks guys. Really loving this new layout builder for posts and archives!!! :grinning:

Chris

Hi Chris,

That is not the category, your homepage actually contain that text “Latest News & Events”. You can add a manual except to your pages/posts for instance like this, but for standard posts it should not be an issue, try searching a keyword “news”

Cheers.

1 Like

Ah, thanks @friech :+1:t2:

Hi Chris,

Glad that we are able to help you.

Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.