Create a detail page

In Sitecore Search, you use detail pages to provide context for item detail pages. A detail page includes at least one widget, often a recommendation widget, which uses the item context to make recommendations based on the item currently being viewed.

Note

One detail page cannot be used for multiple entities. You must create a unique detail page for each entity you are working with.

This walkthrough describes how to:

  1. Define the URL structure of your detail pages

  2. Create a detail page

  3. Review the page setup

  4. Add a widget to the page

Define the URL structure of your detail pages

By providing the structure of the URLs for your item detail pages, you enable Search to recognize those pages as detail pages and use item context to customize the content of widgets. You provide this structure using a regex.

Note

If your implementation includes more than one entity, you need to define a URL structure for each entity you want to create a detail page for.

To set up a regex function to resolve URLs to an entity:

  1. On the menu bar, click Administration > Domain settings > Matching Entities in URL.

  2. Click Edit.

  3. On the card for the entity, fill in the Regex field with a regex that evaluates to the URL structure for items of that entity type.

  4. Click the Attributes field and, in the drop-down menu, select all of the attributes that are used to build the item URLs.

    For example, if you have blogs with the following URLs:

    • /blog/my-first-post

    • /blog/my-second-post

    You can set up a regex like \/blog\/([a-z0-9-]+) to match everything after /blog/ and select the attribute that matches with the matched pattern (my-first-post, my-second-post).

  5. Optionally, you can add query parameters to consider when identifying the entities. To do this, select the Consider the following query parameters check box. Then type the query parameters in the text box, pressing Enter after each one.

  6. Repeat steps 3 and 4 for any remaining entities you need to create detail pages for.

    Note

    To test all your regular expressions against a URL, at the top of the page, click Test RegEx . In the modal that opens, in the URL field, enter the URL and then click Check. The results show whether a regular expression matches the URL. If there is a match, the results show what the match is.

  7. Click Save.

  8. Click Publish. This opens a dialog box. Confirm your changes by clicking Publish again in the dialog box.

Create a detail page

To create a detail page:

  1. On the menu bar, click Pages, then click Create page.

  2. On the Choose page type screen, click Product detail pages.

  3. On the Setup page tab, fill in the Page Name and Page Variation Name fields, then click Next.

  4. On the Attribute & URL tab, in the Entity drop-down menu, select the entity this detail page will be used for.

  5. Click Next.

Review the page setup

To review your page setup:

  1. On the Review tab of the page creation process, click the arrow icons for each of the cards to expand them.

  2. Review the details for each card for accuracy.

  3. If you have to make any changes, click Prev until you get to the tab where the corrections are required.

  4. When you have made corrections, click Next until you get to the end of the wizard.

  5. Click Save.

Note

After clicking save, you have created a page, but it is still empty. Before publishing, you must add at least one widget to the page.

Add a widget to the page

To add a widget to the new page:

  1. On the Page Components tab, click Select Widgets.

  2. In the widget pane on the right, drag the widgets you want to the pane on the left.

    Note

    You can filter the list of widgets by type by clicking on an icon on the top of the widget pane.

  3. Optionally, to reorder widgets on the page, drag widget cards up or down in the left pane.

  4. Click Save.

  5. To deploy, click Publish.

Do you have some feedback for us?

If you have suggestions for improving this article,