Template

Document created by resplin Employee on Jun 6, 2015
Version 1Show Document
  • View in full screen mode

Obsolete Pages{{Obsolete}}

The official documentation is at: http://docs.alfresco.com



JSF Component
The template component provides rendering of Template text files against a Model data using a pluggable templating system. See the Template Guide for more information on template files and data models.



See Also: Template Guide




Back to: Component Library




Tag details


<string>'
  rendered='<boolean>'
  engine='<string>'
  template='<string>' mandatory
  model='<method-binding>'
/>

Alfresco 2.0 Tag Details:

<string>'
  rendered='<boolean>'
  engine='<string>'
  template='<string>'
  templatePath='<string>'
  model='<method-binding>'
/>

Custom Tag attributes


engine


The identifier of the templating engine to use. These come from the web-client-config.xml definitions. If no engine is provided then the FreeMarker default engine will be used.


template


The location of the template text file. The template file can either be located on the ClassPath (e.g. in the folder alfresco/templates under WEB-INF/classes for a TomCat installation) or in the Repository.


  • Therefore this attribute should be set to either a classpath resource such as alfresco/templates/example.flt or bound to a NodeRef value to a content node in the repository.

templatePath


-Available in Alfresco 2.0' - The cm:name based path to the template to render. For example '/Company Home/Data Dictionary/Presentation Templates/my_docs.ftl'.


model


The model to process the template file against. If no model is provided then the default will be used. Information on the default model and providing custom models can be found here in the Template Guide.


Example


Example showing the template component using the default model and a template file on the classpath:

<r:template template='alfresco/templates/example.flt' /> 

Example showing the template component using a custom model and a template file from the repository:

<r:template template='#{MyBean.templateNodeRef}' model='#{MyBean.templateModel}' />

Screenshots


See the Template Guide examples.

Component
Template

Attachments

    Outcomes