Sunday, September 10, 2017

How to import template from theme in Liferay?


We already know how to create web content using structure and template but Sometimes we create template in our theme and then import this in our web content template . So today we will discuss how to import template from theme.

So lets start this step by step:-

Step 1:-Create a template inside theme
I create a theme with name liferayiseasy-theme and then create a test-template.vm inside the _diff folder:-




you can write your template code in this file and deploy the theme.




Step 2:-Import this file inside template
Now click Admin->Content->Manage->Template->Add the template and paste this:-

#set($theme-path = "liferayiseasy-theme_SERVLET_CONTEXT_/templates")

#parse("${theme-path}/test-template.vm")

For more detail you may read how to create structure and template.

Now you can render your web content with this template .

Hope this will Help....

Related Post:-

No comments:

Post a Comment

Total Pageviews

Number Of Unique Visitor

Free counters!