Looking for some advice on how to print the category / search filter on a standard page (will be within an aside class) to allow the user to filter pages by category without having to navigate to the search page.
We are using a similar filter on our publication search page and I did copy over the html from the draft blog search but its not taking effect on the blog listing page.
Is there a way to do this so the blog filter or would this require another asset listing?
Iām not sure Iām fully following, but you might be looking for the Form submission URL option (setting to the Current URL):
The Form submission URL field allows you to control where the search form is submitted. This feature is useful if you nest the search page in another page. By default, this is set to the pageās URL, meaning that the search page will submit to its own URL. The list of results will not be nested in another page, and the user will be redirected to the search page itself. The URL, the lineage, and the menu will change to be the search page. If you set this option to the current URL, the form is submitted to the current page you are viewing (that is, the page in which the search page is nested). This feature means that the list of results will be shown on the original page.
Yes, I think this would help achieve this. I want to have the same sort of category / topic filter that gov.uk use on their blog - https://insidegovuk.blog.gov.uk/
Doing this surfaces the blogs and takes them to a new page so would it be a matter of using the form submission URL method??
Would I first need to create a new search page asset?? Our blog search is driven by a standard page with a REST resource nested within the paint layout associated with that page.
I am not sure if you are using FB or not? You can do it without Funnelback too, but if the number of items you are searching on are too large then it will put excessive load on Matrix server.
You too can achieve this functionality using different ways. It depends on what exactly you are searching on? Is your data residing in a datasource such as CSV data source or JSON data source? or are you searching content in standard pages?
Then the whole thing gets much easier. FB provides a JSON endpoint, which you can call from your frontend to fetch results. Check out this page on how you can effectively query Funnelback.
Is it just a case of inputting that JSON endpoint within a drop-down form action within the aside class where I want this hosted for it to work within the page? Or am I still better creating a search page and nesting this within the paint layout and then using the JSON endpoint?
You would only call the JSON endpoint from the frontend if you had some client side JS code to handle it and render the desired HTML output.
Otherwise, you could pass in parameters via the nested REST asset (by having a form submit to the same page URL) and then handle the result in the JS Processing section of the REST asset. The request URL might be something like:
Hey InnesZ
I use the FB JSON endpoints to filter and or list content extensively throughout our website: example most of the content on our homepage is built using Rest assets calling various FB endpoints.
With filtering you can use the globals_get ā¦search.json?filter_type=%globals_get_<your_value>%&ā¦
With a little JS help is quite doable.
Thanks for all the comments and suggestions. We have had Squiz Support use client side JS with a similar approach to your NickyP and this is working perfectly. The particular script is within the standard page so I have requested for this to be moved to the main JS file as I am using the same script on two pages to get the category filter work on the main blog landing page and blog pages themselves.