Extend content collections This functionality requires additional permissions.

By default, users can only add Sitecore Content Marketing Platform (CMP) content items to content collections. However, as a superuser, you can extend content collections to work with other entity definitions.

In this configuration example, you extend content collections to add Sitecore Product Content Management (PCM) products, including:

Add existing products

To allow adding new products to content collections, you must:

  1. Create a relation between content collections and products.
  2. Edit the search component of the Content collection details page.
  3. Edit the creation component of the Content collection details page.

Create a relation

To create a relation between content collections and products, follow the procedure to add a relation. Make sure to enter the following parameters:

Where Desired field value
Page name M.ContentCollection
Name in New member group dialog box Product
New member dialog box In RELATION, click Select and fill in the following fields:
  • Name: ContentCollectionsToPCM, for example
  • Associated definition: M.PCM.Product
  • Cardinality: ManyToMany

When you have done this, click Save and Apply changes.

Edit the search component

To allow the Content search component to find M.PCM.Product entities, you must:

  1. Edit the filters to include M.PCM.Product.

  2. Edit the output to include the desired product fields in the grid view.

  3. Make the same changes to the Add existing items component.

Filters

To edit the filters of the Content search component, follow this procedure. Make sure to enter the following parameters:

Where Desired field value
Page name Content collection details
In Filters, on the System tab Change the combine operator from and to or
Add filter plus sign Select the Product (M.PCM.Product) definition
Fixed tab Fill in the following fields:
  • Input type: Page entity
  • Filter type: Ancestor
  • Name: ContentCollection

Note

The * symbol is a wildcard. It filters dynamic data related to content collections. In this case, it filters the ContentCollectionsToPCM and ContentCollectionToContent members.

In the final step, change the Filter type back to Relation and click Save.

Output

To edit the output of the Content search component:

  1. On the Content search component page, click the Output tab.

  2. To edit the product grid view, click Grid and click the M.PCM.Product block.

  3. To add the desired fields, scroll down to Fields and click Add plus sign.

  4. Click Save.

Note

The grid view is the default view to display content with thumbnails.

Edit the Add existing items component

Now, make changes to the filters and output of the Add existing items component as follows:

  1. On the Content collection details page, on the Add existing items component, click the switch to enable custom settings.

  2. Click the Add existing items component.

  3. In Filters, on the System tab, click Edit manage icon and change the combine operator from and to or.

  4. To confirm your change, click Save.

  5. On the Output tab, click Grid and then click the M.PCM.Product block.

  6. To add the desired fields, scroll down to Fields and click Add plus sign.

  7. Click Save.

Edit the creation component

To allow the Creation component to link existing products to content collections:

  1. On the Content collection details page, on the Creation component, click the switch to enable custom settings.

  2. Click the Creation component.

  3. Click Link items, and then click Add definition.

  4. In the drop-down list, select the ContentCollectionsToPCM relation.

  5. Click Save.

  6. Click the General section.

  7. Add a label, either a Default or Custom option.

  8. In Linked search component, select Content search and Add existing items.

  9. Click Save and close.

Add new products

To allow adding new products to content collections:

  1. On the menu bar, click Manage manage icon.

  2. Click Pages and find the Content collection details page.

  3. On the Creation component, click the switch to enable custom settings.

  4. Click the Creation component.

  5. Click New entities, and then click Add definition.

  6. In the drop-down list, select M.PCM.Product.

  7. Fill in the fields as follows:

    • Label type: Default or Custom. Here, you select Default.
    • Detail Page: here, you select Product creation (the template page for the creation of a new product).
    • Window type: defines the size of the dialog box used for product creation (Medium modal is the default):
  8. Under DEFAULT VALUES, click Add value.

  9. In the two drop-down lists, click ContentCollectionsToPCM* and Current entity respectively.

  10. To confirm your changes, in the bottom-right of the screen, click Save.

  11. In the top-right of the screen, click Save or Save and close.

    Tip

    To remove, edit, or delete products from a content collection, edit the Selection component to define operations for M.PCM.Product.