Is there a way I can direct users to the sign in page when searching the help center instead of showing "no results"?

Answered

2 Comments

  • Samantha Chavez

    This is not a redirect, but it was intended to be a quick solution to a common customer complaint from my customers. They wanted a prompt when not logged in vs a generic "no results" when looking for articles.  I did a very cheeky attempt without putting a whole lot of brain power into it. I am putting it here for you Matthew Rawls in case it sparks a path or a better idea fo your use. I have sure there is better ways of doing this, but I did not want to waste to much time on it. (Not a pro, I poke and poke until I get what I need when it is not built in to the theme.) I hope this at least helps a little. 

    I basically added an {{#isnt signed_in}} statement to my search_results.hbs right before the final {{else}}. 

    {{#isnt signed_in}}
    <p class="text-gray-600">You are not logged in to the help center. Please log in to view the search
    <a href="https://YOURHELPCENTER.com/hc/enus/signinreturn_to=https%3A%2F%2FYOURHELPCENTER.com%2Fhc%2Fen-us&locale=en-us"> Log in</a>
    </p>
    {{/isnt}}
    {{else}}
    <p class="text-gray-600">
    {{t 'no_results_unified'}}
    {{#link 'help_center'}}
    {{t 'browse_help_center'}}
    {{/link}}
    </p>
    {{/if}}
    1
  • Matthew Rawls

    Samantha Chavez Thanks for this! I created something really similar to this as a workaround. But any one looking for a similar answer, this will work great.

    0

Please sign in to leave a comment.

Powered by Zendesk