Importing Resources for Your Theme

You’ve created the theme for the Lunar Resort, but it’s looking pretty empty at the moment. You need some default content to go with it, so it looks nice when it’s first installed. There are a couple methods you can use to import resources with your theme. You can create an archive.lar file, which imports the LAR with the theme, or you can create a sitemap.json file to hold your layout and populate your content from a directory structure.

Both methods are good options, but there are some disadvantages to using the LAR method. LARs are version dependent, so upgrading to a new version of Liferay means recreating the LAR. Also any changes made to the content require the LAR be recreated.

The sitemap.json on the other hand works in any version of Liferay. You can thus implement changes with a simple redeploy.

In this section, you’ll learn how to use the Resources Importer with the Lunar Resort theme using a sitemap.json. In order to import content with the Resources Importer, you’ll need to create the proper directory structure first.

Setting up the Directory Structure for the Resources Importer

A blank resources-importer directory was created with your theme. Rather than add each file individually and create all the remaining folders, go ahead and delete the existing resources-importer...

Read More

Creating the sitemap.json File

The sitemap.json file defines the layout for the web content, pages, and portlets in your site. As the file extension suggests, sitemap.json uses JSON syntax, so if you are familiar with JSON you...

Read More


In this section, you’ll configure the file for the Resources Importer. Open the file in the WEB-INF folder of the theme. By...

Read More
0 (0 Votes)
Modifying Theme Templates Previous