M6.4 - Templating 1: FreeMarker and Templating Fundamentals

”In this course, you will learn how to build Magnolia page, area, and component templates using FreeMarker and Light Development. Starting from basic template concepts, you will create page templates, dialogs, areas, and reusable components while working directly with JCR content.

 

The course focuses on practical templating techniques, including FreeMarker directives, Magnolia templating functions, resource linking, and parameterized components. You will also learn how to structure templates cleanly, decorate definitions, and debug configurations using the Definitions app. By the end, you will be able to implement flexible, maintainable front-end templates that integrate cleanly with Magnolia’s content model.”

Total time: ~1 day

Prerequisites

”A Magnolia project created using the Magnolia CLI jumpstart is required, as introduced in M6.4 – Content Types and Content Apps, with a running Magnolia instance and Light Development setup in place.

No prior knowledge of content types or content apps is required. Basic understanding of HTML, CSS, and server-side templating concepts is assumed.”

Chapters

No need to watch in order — jump straight to what aligns with your goals.

01
Getting started with Light Development
Start
02
Preparation: Setting up the environment
Watch
03
Magnolia CLI
Watch
04
Light modules
Watch
05
Exercise: Create a light module
Watch
06
Knowledge check
Watch
07
Resource files app
Watch
08
Exercise: Check the light module in the app
Watch
09
Template
Watch
10
Page template
Watch
11
FreeMarker directives - page
Watch
12
Exercise: Create a page template
Watch
13
JCR
Watch
14
Exercise: Check entries in the JCR browser
Watch
15
Resource linking
Watch
16
Exercise: Use 'Twitter Bootstrap' CSS Resource
Watch
17
Knowledge check (CSS)
Watch
18
Dialog
Watch
19
Exercise: Add dialog definition and content
Watch
20
Accessing the content
Watch
21
Render the first Page's content
Watch
22
Area template
Watch
23
FreeMarker directives - area
Watch
24
Exercise: Create an area
Watch
25
Component template
Watch
26
FreeMarker directives - component
Watch
27
Exercise: Create a component template textImage
Watch
28
Knowledge check (FreeMarker)
Watch
29
FreeMarker: Basics
Watch
30
Exercise: 'Text & Image' Component - Create Headline
Watch
31
Templating functions
Watch
32
Exercise: Make use of cmsfn to decode a property
Watch
33
Dam TemplatingFunctions
Watch
34
Exercise: Make Use of the Dam TemplatingFunctions
Watch
35
Linking in JCR & Magnolia
Watch
36
Exercise: Create a Teaser Component
Watch
37
Definition Objects - Parameters
Watch
38
Exercise: Parameterize a new 'textImageParameters' Component
Watch
39
Area Definition - Area Script
Watch
40
Exercise: Use the Area Script
Watch
41
Extra: Retrieving Data From a Workspace
Watch
42
Template References - Overview
Watch
43
Definition decorator
Watch
44
Exercise: Decorate an app label
Watch
45
Definitions App
Watch
46
Congratulations!
Watch
47
Extra Exercise: Render Your Content from the Magnolia Workspace
Watch

About the teacher

Tu Bo Xuan
Senior Solution Architect