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

  1. Navigate to http://glance.clarityvisionsolutions.com:8080/ (the virtual instance you created in the Liferay Administrator course).

  2. 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.

  1. Open the Global Menu (Global Menu), select the Control Panel tab, and click Site Templates under Sites.

    Create a site template through Site Templates in the Control Panel.

  2. Click Add (Add icon) and enter the following information:

    FieldInformation
    NameGlance and Clarity B2B Site Template
    DescriptionThis site template is the base for the Glance intranet site and the Clarity B2B site.
    ActiveOn
    Allow site administrators to modify pages associated with this site templateOn
    Ready for PropagationOn

    Create a site template and name it Glance and B2B Site Template.

  3. 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

  1. Download the resources for this exercise.

    curl https://resources.learn.liferay.com/courses/latest/en/web-site-manager/site-templates/liferay-h2a2.zip -O
    
  2. 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

  1. Open the Site Menu (Site Menu) and select Content & DataDocuments and Media (1).

  2. At the top-right corner of the page, click Options (Options icon) → Export/Import (2).

  3. In the Export/Import modal, select the Import tab.

  4. Click Select File and select the 01-glance-images.lar file → click Continue.

    You can also drag and drop the file into the modal.

    Import the documents and media .lar file.

  5. 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

  1. Open the Site Menu (Site Menu) and select DesignFragments (1).

  2. Next to Fragment Sets, Click Actions (Actions icon) → Import (2).

    Import the custom compositions.

  3. Click Select File and select the 02-glance-compositions.zip file → Import.

  4. 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.

Relevant Concepts

Capabilities

Product

Contact Us

Connect

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