By default, resources are imported into a new site template named after the theme, but you can also import resources into a new site or existing sites or site templates. These options are covered below. Follow these steps:
-
Before specifying where to import your resources, you must enable Developer Mode in your theme. To do this, add the following property to your theme’s
liferay-plugin-package.properties
file. This is enabled by default for themes generated with the Liferay Theme Generator. Without this property enabled, you must manually delete the sites or site templates built by the Resources Importer each time you want to apply changes from your theme’ssrc/WEB-INF/src/resources-importer
folder:resources-importer-developer-mode-enabled=true
-
Specify where to import your resources. By default, resources are imported into a new site template named after the theme. If that’s what you want, you can skip this step. If instead you want your resources to be imported into an existing site template, you must specify a value for the
resources-importer-target-value
property in your theme’sliferay-plugin-package.properties
file:#resources-importer-target-class-name resources-importer-target-value=[site-template-name]
Alternatively, you can import resources into an existing site. You must import your resources into a site if you define both public and private page sets in your
sitemap.json
. To import resources into an existing site, uncomment theresources-importer-target-class-name
property and set it tocom.liferay.portal.kernel.model.Group
:resources-importer-target-class-name=com.liferay.portal.kernel.model.Group resources-importer-target-value=[site-name]
Double check the name that you’re specifying. If you specify the wrong value, you could end up deleting (and re-creating) the wrong site or site template!
-
Deploy the theme. To view your theme and its resources, log in as an administrator, and check the Sites or Site Templates section of the Control Panel to make sure your resources were deployed correctly. From the Control Panel you can easily view your theme and its resources:
- If you imported into a site template, open its actions menu and select View Pages to see it.
- If you imported directly into a site, open its actions menu and select Go to Public Pages to see it.
Great! Now you know how to specify where to import your theme’s resources.