Search Results - select Article type by default

10 Commentaires

  • Ifra Saqlain
    Community Moderator
    Most Engaged Community Member - 2022
    Most Engaged Community Member of The Year - 2021

    Hi :)

    @Rob R

    I worked on your query and I found this:

    Add it to document_head.hbs file.


    Replace this URL with yours:

    https://support.zendesk.com/hc/en-us/community/posts/5683688413338-Search-Results-select-Article-type-by-default

    0
  • Rob R

    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).

    0
  • Ifra Saqlain
    Community Moderator
    Most Engaged Community Member - 2022
    Most Engaged Community Member of The Year - 2021

    O o! I only tested for external URL instead of search results.

    I'll fix it and provide new solutoin.

    0
  • Rob R

    OK, thanks!

    0
  • Kel S.

    嗨,只是礼貌地问这是一些帮助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?


    0
  • Ifra Saqlain
    Community Moderator
    Most Engaged Community Member - 2022
    Most Engaged Community Member of The Year - 2021

    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 :(

    0
  • David Monteiro

    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?


    0
  • Ifra Saqlain
    Community Moderator
    Most Engaged Community Member - 2022
    Most Engaged Community Member of The Year - 2021

    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 :)

    0
  • Fernando

    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

    0
  • Ifra Saqlain
    Community Moderator
    Most Engaged Community Member - 2022
    Most Engaged Community Member of The Year - 2021

    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:)

    0

Vous devezvous connecterpour laisser un commentaire.

Réalisé par Zendesk