Adding a search function to the page

Martin, Heidi (SE GP T SP PS) 571 Reputation points
2024-09-24T07:48:34.36+00:00

Hello,
How can I incorporate a search function into this page to search for specific questions and answers within the sections? What are the steps to achieve this, or what solutions are available for this purpose?

Thank you so much!

Microsoft 365 and Office | SharePoint | For business | Windows
{count} votes

Answer accepted by question author
  1. Yanli Jiang - MSFT 31,666 Reputation points Microsoft External Staff
    2024-09-24T09:08:29.9633333+00:00

    Hi @Martin, Heidi (SE GP T SP PS) ,

    Ok, I got you!

    To add a search function to a SharePoint Online page, there are two options you can choose from:

    Use Web Part Page:

    Web Part Page is a classic page. you can use the out-of-the-box search web part in it. Here are the steps to add it:

    1. Create a Web Part Page.

    092501

    092502

    Fill in the corresponding information and click Create.

    1. Click Add a Web Part, select the web part to be added as shown in the figure below, and then click Add.

    092503

    If it is not available when you add it, you need to enable custom scripts at the organization level and site level, and then try it.

    For your reference:

    https://www.sharepointdiary.com/2017/12/how-to-enable-custom-script-in-sharepoint-online.html

    Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.

    1. After everything is completed, click Stop Editing in the upper left corner to save.
    2. You can also configure the web part settings to customize the search experience, such as the search query.

    For your references:

    https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/search-solutions-in-sharepoint-2013-and-sharepoint-online#search-center-web-parts

    Use Site Page

    Site Page is a modern page that does not support search web parts. However, in order to enable modern pages to implement search functions, some users have developed PnP Modern Search Web Part and uploaded it to GitHub for everyone to use. If you want to implement search on modern pages, you can try using this.

    For your reference:

    https://searchexplained.com/deploy-pnp-modern-search-web-parts-sharepoint-online/

    Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.

    Have a nice day! :-)


    If the answer is helpful, please click "Accept as 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' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.