Leundean Leundean wrote:

> According to 
> https://documentation.magnolia-cms.com/display/DOCS/FreeMarker+reference#FreeMarkerreference-Addingyourowndirectives
>  it should be possible to add model classes for referencing variables in .ftl 
> scripts. Are there any tutorials/examples for this? Following generates the 
> error:  "java.lang.NullPointerException: type" :
> 
> /modules/rendering/renderers/freemarker/contextAttributes/Car - 
> componentClass : Car.class - name: car

The documentation you reference says the following about the componentClass 
property: "set its value to the fully-qualified name of the class". So the 
value of that property should look something like 
"the.package.the.class.is.in.Car" instead of "Car.class".

By the way, I wouldn't use this method unless you want to have access to this 
Car class from every FreeMarker template. You can just specify a model class on 
a specific component (through its 'model' property) and then access that class 
through the variable called 'model' in your template.

Nils.

----------------------------------------------------------------
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to