How to: Create a Site Directory for SharePoint 2013 and Office 365


Back in MOSS 2007, there was an enterprise template called Site Directory which was a site for listing and categorizing important sites in the organization that included different views for categorized sites, top sites, and a site map. Starting with SharePoint 2010, this template was deprecated and no longer available.

Does this mean you cannot have a site directory anymore? No! It doesn’t mean that at all – you just need to use out-of-the-box web parts to create your site directory.  This post will show you how to create your own site directory.

We will be using the search results webpart, so users can search for a site to narrow the results down. This is especially useful if there are a large number of sites in the web application. We will also be copying and modifying an out-of-the-box display template to see the results.

And, another good thing is that when new sites are created, the Result Source automatically picks them up!

NOTE: You need to have an enterprise Search Center for this solution to work.

While there are several articles/posts/blogs on the Internet, this was a solution one of my customers wanted.

  • Download the Item_2LinesNoIcon file to your local machine and rename the file extension to html
  • Go to the Search Center, click on the Gear icon, then choose Site Settings

Figure 1: SearchSiteSettings.jpg

  • Under Site Collection Administration, choose Site Collection Features

Figure 2: SearchSiteCollectionFeatures.jpg

  • Activate the SharePoint Server Publishing Infrastructure feature if it’s not already activated.
    • Note in the screenshot this feature is activated

Figure 3: SharePointServerPublishingInfrastructure.jpg

  • From the Manage Features page, select Site Settings at the top, then select Manage Site Features under Site Actions

Figure 4: ManageFeatures_SiteSettings.jpg

Figure 5: ManageSiteFeatures.jpg

  • From the Site Features page, activate the SharePoint Server Publishing feature if it’s not already activated.

Figure 6: SharePointServerPublishing.jpg

  • Go back to Site Settings, under Web Designer Galleries, select Master pages and page layouts

Figure 7: MasterPage.jpg

  • Select the Display Templates folder, then the Search folder

Figure 8: DisplayTemplates_Search.jpg

  • On the Ribbon, click File, Upload Document, then Browse and select the Item_2LinesNoIcon.html file downloaded earlier then click OK.

Figure 9: FileUploadBrowse.jpg

  • When the dialog box opens for the Master Page Gallery – Item_2LinesNoIcon.html, make sure the Content Type = Item Display Template and check Search Results box for the Target Control Type (Search) and Save.

Figure 10: ItemDisplayTemplate.jpg

  • You’ll now see two (2) files, the Item_2LinesNoIcon.html and Item_2LinesNoIcon.js. Click the Site Contents link.

Item 11: FilesUploaded.jpg

 

  • On the Site Contents page, click Pages

Figure 12: Pages.jpg

  • On the Pages page, click Files, click the down arrow next to New Document, then choose Page.

Figure 13: NewPage.jpg

  • On the Create Page, give the directory a title (i.e. Directory), the URL Name will be automatically populated but you can change this, then select (Welcome Page) Search results and click Create

Figure 14: CreateDirectoryPage.jpg

  • Back on the Pages page, check-in the Directory page

Figure 15: CheckIn.jpg

  • In the pop-up dialog Check in box, select Major version (publish) and No to retain checkout then click OK

Figure 16: MajorVersion.jpg

 

  • While still on the Pages library, click the Directory document to open it and it will open a Search site

Figure 17: InitialSearchCenter.jpg

  • Now to filter this to our sites. Click the Gear icon and choose Edit Page

Figure 18: EditPage.jpg

  • In the Search Results section, click the down arrow and choose Edit Web Part

Figure 19: EditWebPart.jpg

  • In the Properties for Search Results web part, click Change Query

Figure 20: ChangeQueryButton.jpg

  • In the Build Your Query dialog screen, Switch to Advanced Mode

Figure 21: AdvancedModeQuery.jpg

 

  • Under Query text, type the following:
  • {searchboxquery}(contentclass:”STS_Site”) path:http://sharepoint.domain.com/*
    • Use the name of your site for the path variable
    • Click the Test Query button

Figure 22: QueryText.jpg

  • Next, select the Sorting heading and choose SPSiteURL Ascending then click OK

Figure 23: Sorting.jpg

 

  • Back at the Properties for Search Results web part, expand Display Templates and select Use a single template to display items and choose the Item_2LinesNoIcon template, then click Apply

Figure 24: ApplyDisplayTemplate.jpg

  • You should now be able see results in the Search Results web part on the page

Figure 25: QueryResults.jpg

  • Click OK to close the web part
  • Check-in the page

Figure 26: CheckInPage.jpg

  • On the Check In dialog box, add comments if you want then click Continue

Figure 27: CheckInDialog.jpg

  • Now, when users search for a site, it will only return the results based on the query.

Figure 29: SiteQuery.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  • Finally, if you want a navigation link to the Site Directory page, click the Gear icon and choose Site Settings. Under the Search heading, select Search Settings

Figure 30: SearchSettings.jpg

  • On the Search Settings page, in the Configuration Search Navigation, click Add Link. In the Navigation Link dialog box, add a Title and either type in the URL of the Directory page or click Browse and select the page from the Pages library then click OK

Figure 31: NavigationLink.jpg

 

  • Click OK to close the Search Settings page then go back to the Search Center
  • In the Search Center, type a word or phrase to search then view the results

Figure 32: BIResultsEverything.jpg

  • Notice the word “Everything” is highlighted showing all results. Now, click the Directory link and only sites that start with BI will be shown.

Figure 33: BISite.jpg

As I said before, there are many ways to accomplish creating a site directory but this solution doesn’t require any 3rd party tools or utilities.

Resources:

 

 

 

 

 

 


Comments (2)

  1. Ꭼxсelⅼent ρоst. I was checking constantly this blog and I amm impressed!

    Very useful info specially the last padt 🙂 I care
    forr sucɦ info a lot. I was seeking this partticular info for a ⅼong time.
    TҺank you and good luck.

  2. sheet music says:

    The instructіons aгe eɑsy to follow, and often fun. In modern timeѕ, it is even easieг tо play
    a piano. Myth: I will never be able to play with bοth hands.

Skip to main content