Exporting and Importing Page Templates
Sometimes it’s easier to edit templates in a code editor. Once you’ve created a Page Template, you can export it, edit it locally in the editor of your choice, and then import the template back into Liferay. You can import the template into any Site on the system.
For more general information about the Export/Import Framework, see Exporting/Importing Site Pages and Content.
For Liferay DXP 7.4+, Page Template Collections are called Page Template Sets in the Liferay UI.
Exporting a Page Template
Follow these steps to export a Page Template:
Open the Site Menu (
) and go to Design → Page Templates.
Click the Page Templates tab.
Select the Page Template Set that contains the desired template.
Click the Actions button (
) for the desired Page Template and select Export.
Click OK in the confirmation window.
The Page Template downloads as a ZIP file to your local machine.
You can export more than one Content Template at once. However, you cannot include Widget Templates with Content Pages in the same ZIP file.
The last published version of the Page Template is always exported. If the Page Template has never been published, it cannot be exported.
The exported ZIP file contains these files:
page-template-collection.json
: Includes the name of the Set where the Page Template is saved and any other metadata- An optional thumbnail file
page-template.json
: Contains the Page Template name and any other metadatapage-definition.json
: specifies the structure and content of the Page Template.
The ZIP file may contain different types of page templates as well, like display-page-template.json
, master-page.json
, page-template-collection.json
and page-template.json
.
Importing a Page Template
Follow these steps to import a Page Template:
Open the Site Menu (
) and go to Design → Page Templates.
Click the Actions button (
) in the Application Bar and select Import.
Select the desired Page Template file.
Click Import.
Close the Import window.
The Page Template has been imported into the Site.