Learn2 + a standalone search page

Hi all, very new to web development but I’ve decided to use grav as my foundation for learning. :slight_smile:

Wondering if anyone can point me in the right direction for displaying a standalone search page in learn2 as opposed to the current method, which filters the page list to items containing the query.

I’ve managed to get it working as a url (adding /search/query:something), and in other themes, but it seems like there’s something in the learn2 theme preventing me from using the built in search box for this.

Thanks for any help/tips.

I guess the first question is are you starting with the RTFM skeleton? That has a very specific implementation of simplesearch. It uses a special javascript/ajax solution to get results back and filter the existing sidebar.

Yup, I started off with the RTFM skeleton + admin plugin.

It’s going to require some digging and rooting around to remove all the current JS/Ajax implementation first. Then you can just use the default state of simplesearch as that will work out of the box with a page of results.

I dont’ have time to give you a step by step of all this :), but basically yo’ll need to remove the current search form in the sidebar.html.twig and include the one that comes with simplesearch plugin (or a modified version of it).

Then you’ll have to use the simplesearch_restults.html.twig template from the plugin, and create a copy in your theme that extends the base template appropriately.

It’s not a totally simple job, but it’s very doable.

Thanks! I’ll make a backup and start fiddling around. :slight_smile: