Freemarker theme templates instead of velocity

By default, liferay themes uses velocity templates. For example, classic theme (.../tomcat-6.0.x/webapps/ROOT/html/themes/classic/templates) uses several (*.vm) velocity templates. But Liferay portal may use freemarker templates (*.ftl) instead.

To usee freemarker instead of velocity open liferay-look-and-feel.xml
    <theme id="..." name="...">
        <template-extension>vm</template-extension>
        .....

and change template-extension  value from 'vm' to 'ftl'.

Since Liferay 6.0 and GA3.

Blogs
What are the main advantages of one or the other?
Velocity tends to be 'plan and simple' template language and it can work well. It is an old project, has a large community, code is fast enough, and the syntax is easy and fixed. Sometimes, this is a right thing.

Freemarker, on the other hand, has much more power inside. It is more complete as template language, has good documentation, API, has more advance template syntax, supports JSP taglibs, has advance macro system (libs, default params...), less dependencies... You can also check what FM authors says about it: http://freemarker.sourceforge.net/fmVsVel.html

Please note that I am talking here about features, but are they advantage or not... it is for you to decide;)
Hey Igor,

do you have any idea where the *.vm velocity templates gets the $init variable they are #parsing ? Because in the classic html template there is only init.ftl currently...I grepped through the entire html directory and the $init variable is not declared anywhere
Class com.liferay.portal.velocity.VelocityVariables creates 'init' variable (line #466; or just search for "init" - with quotation marks).

The init.vm file is located here: tomcat-6.0.29\webapps\ROOT\html\themes\_unstyled\templates\init.vm

I hope this helps youemoticon
Thanks Igor. I was searching for '$init' withing the .vm templates, it didn't occur to me it was initialized already in VelocityVariables. Cheers