Creating a Site Template and Uploading Files
You’ll create your site template in Clarity’s internal virtual instance. If you’re following along locally, this was created in the Liferay Administrator course and can be found at http://glance.clarityvisionsolutions.com:8080
. If you haven’t run through the Administrator course, follow the steps in Configuring Virtual Instances, and then come back here.
Use the Virtual Instance
-
Navigate to
http://glance.clarityvisionsolutions.com:8080/
(the virtual instance you created in the Liferay Administrator course). -
Log in as Kyle Klein, the instance’s administrator.
If you just created the virtual instance, it has no user accounts. Create one for Kyle Klein so he can administer this instance as well. Follow the steps in Create an Administrator to register Kyle and make him an administrator of this instance, and then come back here.
Create a Site Template
Once in the virtual instance, you can create a site template to be used to create other sites.
-
Open the Global Menu (), select the Control Panel tab, and click Site Templates under Sites.
-
Click Add () and enter the following information:
Field Information Name Glance and Clarity B2B Site Template Description This site template is the base for the Glance intranet site and the Clarity B2B site. Active On Allow site administrators to modify pages associated with this site template On Ready for Propagation On -
Once you create the site template, click on its Name. The site template opens in a new tab. You can start editing the template now.
Import Resources
-
Download the resources for this exercise.
curl https://resources.learn.liferay.com/courses/latest/en/web-site-manager/site-templates/liferay-h2a2.zip -O
-
Unzip the file.
unzip liferay-h2a2.zip
This .zip file includes elements that you’ll use to create your site template (e.g. images, custom fragments, and custom compositions).
Import Images
-
Open the Site Menu () and select Content & Data → Documents and Media (1).
-
At the top-right corner of the page, click Options () → Export/Import (2).
-
In the Export/Import modal, select the Import tab.
-
Click Select File and select the
01-glance-images.lar
file → click Continue.You can also drag and drop the file into the modal.
-
Use the default configurations and click Import. Once the process is finished, close the modal.
You can use the imported images throughout the site template now.
Import Compositions
-
Open the Site Menu () and select Design → Fragments (1).
-
Next to Fragment Sets, Click Actions () → Import (2).
-
Click Select File and select the
02-glance-compositions.zip
file → Import. -
Once the process is finished, click Done.
You can use the custom compositions throughout the site template now.
The rest of the files will be used in future lessons.
Next, you’ll create the master page template.