Embed Catalog Items in a Content Page

Abstract

Present catalog items in a content page as part of a marketing effort.

Complete the following prerequisites:

  • Associate an Existing Catalog to a SitecoreSite

  • There are one or more virtual or base catalogs containing product and category definitions.

  • You have created a rendering under /sitecore/layout/Renderings/ with appropriate code-behind or controller.

At the Content Editor:

  1. Add a control.

    1. Click the content item in the tree

    2. Click PresentationDetails in the ribbon.

    3. Click Edit on the device control.

    4. Click Controls

    5. Click Add, find your rendering, set its Placeholder and click on the Select button

  2. Choose one:

    Set a data source on the rendering

    continue to the next step

    Add an associated product field to the content item

    continue to 6

  3. Click your control in the device editor.

  4. Click Edit on the device control.

  5. Select a product and click OK.

    If you are using MVC, you can retrieve the data source in your controller using the following: RenderingContext.Current.Rendering.DataSource

    If you are using WebForms you can retrieve it in your code behind using the following ((Sublayout)Parent).DataSource

  6. Close the Presentation Details dialog

    You have completed this procedure.

  7. On the template for the content item:

    1. Add a new field called AssociatedProducts

    2. Set the type to Treelist (or Treelist with Search)

    3. Set the source to /sitecore/Commerce/Catalog Management/Catalogs