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.
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:
-
On the menu bar, click Manage
.
-
On the Manage page, click Print templates.
-
On the Print templates page, click New Print template.
-
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
-
Click Create.
-
To upload the print template package, click Select file.