Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

A template script renders output. Typically that output is HTML. The script is written in a templating language such as FreeMarker or JSP. The script instructs the renderer where to place the content on the page and contains placeholders for content attributes such as headings and images.模板脚本绘制输出。通常这种输出是HTML。脚本用如FreeMarker或JSP这样的模板语言编写。脚本指导绘制者将内容放到页面的什么位置,并为类似标题和图片的内容提供占位符。

Table of Contents

Scripting languages and renderers

脚本语言和绘制器

Magnolia CMS为FreeMarker和JSP提供可立即使用的绘制器。您可以选择偏好的语言,甚至可以在相同的网站上混合使用,在一些模板里使用FreeMarker而另一些里用JSP。 Magnolia CMS provides renderers for Freemarker and JSP out of the box. You can choose the language you prefer. You can even mix languages on the same site, using Freemarker in some templates and JSP in others.

Freemarker

At Magnolia we prefer Freemarker for its flexibility, cleaner syntax and better error reporting, but also because it does not depend on the file system. Templates do not have to be extracted to the file system. This means you can store them in the repository and access like any other resources, apply version control if you wish, and add custom properties and metadata.

...