最近搜索
没有最近搜索
Restrict search bar
已回答
已于 2023年4月03日 发布
Is there a way to prevent users who aren't signed in from using the search function?
0
1
最近搜索
没有最近搜索
已于 2023年4月03日 发布
Is there a way to prevent users who aren't signed in from using the search function?
0
1 条评论
Greg Katechis
Hi Jack! You could use an if statement with the signed_in property to wrap around the search functionality. For example, if you are using the default Copenhagen theme and wanted to hide the search functionality on the home page, you would go to home_page.hbs and add {{#if signed_in}} on line 5 and then close that on line 12 with {{/if}}, like this (bolded portions are what I added):
Note that you would need to do that in each template that you wanted to restrict, such as the category, section, and article templates. You could probably come up with a more elegant solution using JS, but I just wanted to give you the general functionality for accomplishing this!
0