Dashboard > blojsom 3.0 > ... > Template Dispatchers > Freemarker Dispatcher
  blojsom 3.0 Log In   View a printable version of the current page.  
  Freemarker Dispatcher
Added by David Czarnecki, last edited by David Czarnecki on Jul 11, 2007  (view change)
Labels: 

Description

Freemarker is an alternative to Velocity and this dispatcher allows you to use Freemarker to define page templates for your blog.

Installation and Configuration

You must download the blojsom add-on bundle. It is available as a separate download with each release of blojsom.

  • Unpack the add-on bundle ZIP file.
  • Copy the freemarker-2.3.jar to your blojsom installation's /WEB-INF/lib directory.

In your /WEB-INF/classes/blojsom.xml file, add the following:

<bean id="ftl" class="org.blojsom.dispatcher.freemarker.FreemarkerDispatcher" init-method="init">
        <property name="freemarkerProperties">
            <ref bean="defaultFreemarkerProperties"/>
        </property>
        <property name="blojsomProperties">
            <ref bean="defaultProperties"/>
        </property>
        <property name="servletConfig">
            <ref bean="servletConfigFactoryBean"/>
        </property>
    </bean>

The defaultProperties bean should already be configured.

<bean id="defaultProperties" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
        <property name="properties">
            <props>
                <prop key="default-blog">default</prop>
                <prop key="ignore-flavors">admin, rsd</prop>
                <prop key="installed-locales">de, en, fr, jp, ko, pt_BR, sv, zh_CN</prop>
                <prop key="resources-directory">/resources/</prop>
                <prop key="templates-directory">/templates/</prop>
                <prop key="themes-directory">/themes/</prop>
                <prop key="blogs-directory">/blogs/</prop>
                <prop key="bootstrap-directory">/bootstrap/</prop>
            </props>
        </property>
    </bean>

You will need to configure the defaultFreemarkerProperties bean similar to the defaultProperties bean. This is where you would configure Freemarker options.

Usage

You can find a reference for the Freemarker template language online.

Site running on a free Atlassian Confluence Open Source Project License granted to blojsom. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.4 Build:#809 Jun 12, 2007) - Bug/feature request - Contact Administrators