Search in the Documentation:

To render a page, you need a template

We’ve seen that each node at some point must be processed through a view to add some formatting instructions, but a node alone is nearly never displayed as-is to readers. Actually, whatever the support they use (web browser, mobile application, etc.), readers receive web pages that includes headers, footers, navigation bars, breadcrumb, etc. instead of only one single node.

A page is therefore an assembly of nodes, driven by a template. The template is nothing more than a guide which

  • Specifies the position of various elements in the page
  • Load the necessary resources (CSS, Javascript) to apply layout/design instructions
  • Renders some items that must be shared between pages

During the rendering process, content (content nodes processed with a view) and templates are blended together to produce the final pages.

[image]

In the example presented above, we are requesting a content object from the Java Content Repository (a.k.a. JCR) that is located on the home page and that is called “bellini”. Jahia will therefore first use the URL to find the corresponding content object, and then starts looking for different objects that will help render the final page.

The template defines the layout of the final page: the positions of all content items and loads the static resources like Javascript files and CSS stylesheets.

It is now time to look at how those definitions, views, templates and other advanced features may be deployed into Jahia. This is where modules come into play.