Book Image

Liferay 6.x Portal Enterprise Intranets Cookbook

Book Image

Liferay 6.x Portal Enterprise Intranets Cookbook

Overview of this book

Table of Contents (19 chapters)
Liferay 6.x Portal Enterprise Intranets Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Creating a new template


This recipe requires basic programming skills. In general, a template is a pattern to render values from an article with a specific structure. In accordance with this fact, a template is relative to the structure, so a structure and template are a pair of definitions that can't exist alone. Structures define how the form looks; templates determine how the journal article will be rendered and arranged.

Getting ready…

Prepare a structure called Internal publication. To see how to achieve this, refer to the previous recipe.

Let's assume that our template is divided into four parts:

  • Metadata definition that contains Author and Department

  • Metric definition with Client and Project information

  • Description part with Content

  • Attachments section

How to do it…

Liferay gives users three languages to write a template: Velocity (.vm), FreeMarker (.ftl), and Extensible Stylesheet Language (.xsl). Regardless of the language definition, the process of creating a new template consists of...