Example - creating a print template

The Print template entity is a ZIP package containing .cshtml, .json, and .css files defining the structure of the PDF file.

Note

To configure Content Hub, you must either be a superuser or have the necessary permissions granted to you through user group policies.

In the following example, you create a ZIP package to print Recipe content types from the Sitecore Content Hub to a PDF template.

The PDF output should contain:

  • A Preview rendition

  • Content Name

  • Recipe_Title

  • Recipe_Ingredients

  • Recipe_Nutritionalfacts

Put these three files in a ZIP file. In the following example, you can use this ZIP folder.

Upload the print template

To upload the Print template to Sitecore Content Hub:

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

  2. On the Manage page, click Print templates.

  3. On the Print templates page, click New Print template.

  4. In the New Print template dialog, fill out the following fields:

    Field

    Description

    Example

    Name

    The name of the print template.

    CMPRecipePrintTemplate

    Target definition

    The definition of entities in the PDF file.

    Content (M.Content)

    Custom properties

    Extra properties to specify when generating the PDF file.

    None for this example

  5. Click Create.

  6. To upload the print template package, click Select file.

Do you have some feedback for us?

If you have suggestions for improving this article,