Exporting and Importing Page Templates

Sometimes, it’s easier to edit templates in a code editor. After you create a page template, you can export it for local editing. Once you’ve made the necessary changes, you can import the template back into Liferay and use it in any site in the system.

For more general information about the export/import framework, see Exporting/Importing Site Pages and Content.

Warning

For exporting purposes, content page templates are fully supported, while widget page templates can’t be exported.

Exporting a Page Template

  1. Open the Site Menu (Site Menu), expand Design, and go to Page Templates.

  2. Select the Page Templates tab.

  3. Select the page template set that contains the desired template.

  4. Click Actions (Actions button) for the desired content page template and select Export.

    Click Export to export your page template as a ZIP file

The content page template downloads as a ZIP file to your local machine.

Tip

You can export more than one content page template at once.

The last published version of the page template is always exported. If the page template has never been published, it can’t 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 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. In the Page Templates application, click Options (Options icon) in the Application Bar and select Import.

    The import function is located in the options menu in the Application Bar.

  2. Select the desired page template file.

    Click Replace File if you want to change it.

  3. Click Import.

    If you import an existing page template, see Importing an Existing Page Template for more information.

    To cancel the operation and go back to the page templates page, click Cancel.

    Page templates are imported as ZIP files.

  4. Once the importing process is complete, you are redirected to an import outcome page.

  5. Click Upload Another File to import another file or Done to go back to the page templates page.

Important

To transfer page templates between DXP environments, use the LAR export and import method.

Importing an Existing Page Template

If you import a page template and items from the ZIP file already exist, you can select one of three options:

Do Not Import Existing Items: Only new items are imported.

Overwrite Existing Items: Duplicated existing items are overwritten.

Keep Both: A numbered copy of existing items is imported.

Once the importing process is complete, you are redirected to an import outcome page.

Choose one of three options when you import a duplicated page template

Import Outcome Page

When users import files, they are redirected to a new page with details about the importing process.

On the import outcome page, users can see the successfully imported entries, warnings (successful imports that could cause malfunctions), and errors (entries that weren’t imported).

The import outcome page shows warnings and errors related to the importing process

Capabilities

Product

Contact Us

Connect

Powered by Liferay
© 2024 Liferay Inc. All Rights Reserved • Privacy Policy