Documentation

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.

Tip

Page Templates are part of the larger Collections framework. For more information, see About Collections and Collection Pages.

For more general information about the Export/Import Framework, see Importing/ Exporting Sites and Content.

Exporting a Page Template

  1. Navigate to the Site where the Page Template has been created.

  2. Click the Product Menu (Product Menu).

  3. Click DesignPage Templates.

  4. Click the Page Templates tab.

  5. Select the Collection where the page template resides (for example, Collection 1).

  6. Click the Options (Options) icon next to the desired Page Template.

  7. Click Export.

    Click Export to export your Page Template as a Zip.

  8. Click OK in the confirmation window.

The Page Template downloads as a ZIP file to your local machine.

Tip

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: Contains the name of the Collection 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 metadata

  • page-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

  1. Navigate to the Site where the Page Template is to be imported.

  2. Click the Product Menu (Product Menu).

  3. Click DesignPage Templates.

  4. Click Options (Options) at the top right → Import.

    The Import function is located at the top right Options menu.

  5. Click Browse and navigate to your Page Template file.

  6. Click Open in the browser window.

  7. Click Import.

    Page Templates are imported as ZIP files.

  8. Close the Import window.

The Page Template has been imported into the Site.