Recent searches
No recent searches
Is there a way I can direct users to the sign in page when searching the help center instead of showing "no results"?
Answered
Posted Oct 12, 2021
Currently, all our users must be signed in to view any help articles. However, anyone can search from the home page. If users are not signed in, they will receive "no results" for their search. Can I redirect them to a sign in page instead of showing no results?
1
3
3 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}}.
2
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
Lindsey
Would a work around like this be possible for one article that is behind sign-in?
0