SharePoint 2016 - Custom Page - SharePoint Search Box Web Part missing for users with less than 'Member' access

Rene Wagner 161 Reputation points
2021-11-03T22:35:56.767+00:00

Hello,

I have an on-prem SP 2016 site where we created a custom page. On that page we added a Search Box web part that uses a custom Search box control Display Template. The page saves just fine and as the user that created the page (Site Admin) I can browse to the page and the Search Box control appears as expected and I can run a search.

If I access the page as a Site Member, the page also works fine and the search box is displayed and is functional.

However, if I access the page as a Site Visitor, when the page loads, the Search Box is not displayed. Instead I get an error that seems to indicate that the display template cannot be found -- but I know it exists and works if logging in as a Site Admin or Member user.

I checked the permissions on the JS and HTML files associated with the display template we created and it appears to match what the out-of-the-box display templates have, so permissions on the template appear fine.

Why would a user with Visitor (View Only) access not be able to see the Search Box on a page? What am I missing?

Thanks

Microsoft 365 and Office SharePoint Server For business
0 comments No comments
{count} votes

Accepted answer
  1. Allen Xu_MSFT 13,861 Reputation points
    2021-11-04T07:04:52.387+00:00

    Hi @Rene Wagner ,

    • What is the page type of your custom page? If it is a pblishing page, make sure it is not a draft and has been published.
    • Be sure that you have published the JS and HTML files associated with the display template in the master page gallery. If you have published it already, try to re-publish it.
    • Did you get an error like below? Kindly share here the screenshot of the error. In 99 percent of the cases, this error is related to a bug in the code. That one percent will probably be related to someone that has deleted or moved the template. So if that is the case, you will have to put it back in place.
      146458-image.png
      As the error does not say much, the best way to solve it is to open your browser developer tools (f12) and go to the console first. In the browser console, check if there is an error logged. In most cases when you wrote a bug in the display template, you will see it in the console like in this example:
      146438-image.png
      If you click on the file link, the developer tools load the file and shows you where the error occurs.
    • Also you can check the SharePoint ULS logs, find if there is any related clue to hte error in the ULS logs.

    ----------

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.