Search Results - select Article type by default
Hi all,
有可能选择默认theArticlestype on the search results page (instead ofAll types)?
We're finding in our help center that most users don't even know to select theArticlestype to show theBy categorysubfilter. We didn't even realize that function ourselves when we were building the help center. It's just not intuitive.
IfArticlesis selected by default, users will always see the categories.
Thanks
-
Hi :)
I worked on your query and I found this:
Add it to document_head.hbs file.
Replace this URL with yours:
-
Thanks for the quick reply, Ifra!
The only thing is that the page still loads to the standard results view,thenone second later it refreshes to the redirect URL. I thought the '0' in the code is supposed to make it immediate?
Side note: I needed to change/searchtosearch?utf8, since both the original results URL and the redirect both contain/search(and resulted in a page refresh loop).
-
O o! I only tested for external URL instead of search results.
I'll fix it and provide new solutoin.
-
OK, thanks!
-
嗨,只是礼貌地问这是一些帮助I can't get the code to work (it goes in the loop as mentioned by Rob).
Is the URL that's meant to be replaced (https://support.zendesk.com/hc/en-us/community/posts/5683688413338-Search-Results-select-Article-type-by-default) supposed to be the just the domain? The link to the search page?
And with the replacement of the search?utf8, does that mean the code is this?
-
HiKel S., actually when you add external URL in the code it won't be stuck in a loop but I'm checking the search page in the condition so the page is same on every reload that's why code executes again and again.
I tried to solve it from my side but my bad :(
-
HiIfra Saqlain,
I had the same issue in the sense that I wanted the user to able to clearly understand where their search was applied - and we don't have a community yet.
I'm using the following script based on yours :)But would there be a more elegant way to do it? Especially that doesn't involve a refresh of the page?
-
HiDavid Monteiro, I tried it to get it done but that same bug occurs, infinite page refresh loop...
The code is working for external URL but when I try for search page I stuck in same issue :)
-
Ifra Saqlain, after a lot of tinkering I was able to add the script tag below at the bottom of thesearch_results.hbswith the following results:
- Hide the Menu with Source and Category on the side
- Select the Category by default
- Show all Categories expanded
-
Mr.Fernando, it's really nice trick and it will help to other members. Thank you so much that you shared it here andI learned it too:)
Vous devezvous connecterpour laisser un commentaire.
10 Commentaires