Product DocsMenu

Coveo Platform 7.0 >
Administrator Help > Coveo .NET Front-End 12.0 > Enabling the Scope Selector in Microsoft SharePoint

Enabling the Scope Selector in Microsoft SharePoint

In Microsoft SharePoint, the scope selector is a control that you can add next to the Coveo search box to allow users to select the scope in which the search should be performed. Scopes are defined by the administrator.

Scope selector
Coveo search box integrated in Microsoft SharePoint

As a Coveo administrator, you can enable the scope selector in Microsoft SharePoint by editing the searchBox.ascx file in the skin used by your SharePoint interface.

Note: In the case of a SharePoint farm, you must perform the following procedure for each SharePoint server.

To enable the scope selector in Microsoft SharePoint

  1. Using an administrator account, connect to the SharePoint server on which Coveo is installed.

    Important: It is not recommended to customize the default skins provided by Coveo. Default skins are overwritten when upgrading CES. The best practice is to create a renamed copy of the default skin, and then modify and use the new skin.

  2. Unless you are already using a custom skin, in the [.Net_Front-End_Path]\Web\Coveo\Skins\ folder:

    1. Make a copy of the SharePoint folder.

    2. Rename the folder copy to the name of your choice.

      Example: SharePointScopeSelector

  3. Using a text editor:

    1. Open the searchBox.ascx file from your new skin folder.

    2. Add the following lines of code:

      <td style="padding-right: 2px">
         <select id="DDLScope" runat="server"/>
      </td>  

      as shown in the following excerpt (after line 12):

      <table cellspacing="0" cellpadding="0">
        <tr>
          <td>
            <input type="text" id="TXTQuery" style="font-size: 9pt" runat="server"/>
          </td>
          <td style="padding-left: 2px">
            <% ((BetterImage) BTNSearch).ImageUrl = SearchBox.SearchImage.Resolve(); %>
            <% ((BetterImage) BTNSearch).HoveredImageUrl = SearchBox.SearchHoveredImage.Resolve(); %>
            <% ((BetterImage) BTNSearch).ToolTip = SearchStrings.Search; %>
            <% ((BetterImage) BTNSearch).Style["cursor"] = "pointer"; %>
            <cnlb:BetterImage id="BTNSearch" runat="server"/>
          </td>
          <td style="padding-right: 2px">
            <select id="DDLScope" runat="server"/>
          </td>
        </tr>
      </table>  
    3. Save the file.

  4. Reset IIS on the server to make the changes effective (see Resetting IIS).

  5. Unless you modified an existing custom skin, you must now configure the SharePoint search interface to use the new skin that you created:

    1. Using a Coveo administrator account, access a SharePoint page where the Coveo search box appears, and then launch any query to open the search interface.

    2. In the upper-right corner of the .NET search interface, in the Do More menu, select Edit this Interface.

      Note: The Edit this Interface command of the Do More menu only appears for a Coveo administrator.

      The Interface Editor opens with the SharePoint interface as the current interface.

    3. Under Basic Configuration, in the Skin drop-down list, select the new skin that you created.

      Note: The new skin will appear only after performing the IIS reset.

    4. Click Apply.

  6. Validate that the scope selector is available to users:

    1. Clear the cache of your browser and then close the browser.

    2. Restart the browser, open a SharePoint page where the Coveo search box appears to verify that the scope selector appears next to the search box.

People who viewed this topic also viewed