Creating a Page Template¶
Available: Liferay DXP/Portal 7.3+
Page Templates help you efficiently create pages based on predefined layouts and content. There are several basic page templates available out-of-the-box.
You may also create your own Content Page Templates and Widget Page Templates, as described below.
Note
For Liferay DXP 7.4+, Page Template Collections are called Page Template Sets in the Liferay UI.
Creating a New Page Template¶
The steps below show how to create and use Widget and Content Page Templates.
Open the Product Menu and go to Site Builder → Pages.
Select the Page Templates tab.
Click New and create a new Set to organize your Page Templates.
Click the Add icon (
) and select either Widget Page Template or Content Page Template. You can return to the Page Template’s configuration at any time by clicking the Actions icon (
) next to the Page Template in the Set and selecting Configure.
Enter a Name.
Click Save.
You’re automatically transported to the new Page Template. Follow the instructions in Widget Pages to create your Widget Page Template. Likewise, see Building Content Pages to configure your Content Page Template.
Creating a Page Template from an Existing Page¶
You can also create a Page Template from a page while you are editing it. The new Page Template keeps all of the same configurations for Fragments and widgets when it is created. This saves you time making more templates for pages that you may decide to reuse as you expand your Site.
Note
You must already have a Page Template Set created to create a Page Template from a page to add to it.
Follow these steps to make a Page Template from a page:
While editing the page, click the Create Page Template button near the top of the screen.
In the modal that appears on the screen, enter a name for the new Page Template.
Select the Page Template Set where you’re adding the new Page Template.
Click Create.
The chosen Page Template Set now has a new Page Template based on the page you are currently editing, as a draft. You must publish this Page Template draft to use it for new pages.
Additional Information¶
Propagating Changes for Widget Pages¶
When creating a page from a Widget Page Template, changes are inherited from the Page Template by default, so future changes are automatically propagated to the pages that use the Page Template. Site Administrators can disable this behavior through the settings for the individual page.
Propagating Changes for Content Pages¶
Changes for Content Pages are not automatically propagated when created using a Content Page Template. However, you can propagate changes to Fragments used on a Content Page. See Propagating Fragment Changes for more information.
Staging and Page Templates¶
Important
Staging functionality is in maintenance mode as of 7.3 GA1+.
If staging has been enabled, changes to the Widget Page Template are automatically propagated to the staged page. These changes must still be approved before the page is published to the live site. For this reason, the automatic propagation of Widget Page Template changes to the staged page cannot be turned off and the Inherit Changes selector does not appear.