-
Book Overview & Buying
-
Table Of Contents
Apache OfBiz Cookbook
If none of the existing FreeMarker transforms meet your requirements, you may always create your own. FreeMarker transforms are Java classes configured to perform an inline conversion when used within a FreeMarker template.
To create your own FreeMarker transform, follow these steps:
1. Create the Java class that implements the TemplateTransformModel Java class.
2. Rebuild the Component containing the transform.
3. Add the transform's Java class package name to the following Java property file so that it will be loaded on the CLASSPATH and available for use:
~framework/webapp/config/freemarkerTransforms.properties
4. Restart OFBiz.
5. Use the transform in a FreeMarker template by wrapping content in the transform tags.
Writing a Java FreeMarker transformation is a simple way of extending FreeMarker data formatting capabilities for use across the entire OFBiz instance.
There are many examples of custom FreeMarker transformations...
Change the font size
Change margin width
Change background colour