BLOG: Web Content Management

Welcome to Oshyn’s Web Content Management Blog where our experts discuss the latest developments and best practices in the Content Management industry with a focus on several leading platforms: Drupal, EPiServer, Jahia, Open Text and Sitecore.

Jahia WCM Quick Review: Maven, Templates and Navigation

Jahia WCM Quick Review: Maven, Templates and Navigation

Juan Pablo Albuja... - Wednesday, December 16, 2009

Introduction
Jahia is a Web Content Management System (WCMS) integrated with Document Management (DMS) and Portal Features. This solution offers development, integration and management of content for intranet, extranet and Internet networks and is an excellent alternative to Alfresco CMS.

For template developing with Jahia V6 is important understand the existing structures illustrated in the following image and they are:

 

  • Fields: Basic structure that needs to exist inside a container and the principal function is to structure data. The types of fields are: smallText, sharedSmallText, bigText, date, page, file, portlet, integer, float, Boolean, category, color, and field selectors.
  • Containers: Logical entity that groups fields and container lists.
  • Container Lists: List of containers of a specific definition.
  • Pages: They are similar to html pages. Jahia pages are associated to a template described in a jsp file. They declare the content structure of a page and they can contain single containers and container lists.

 

Templating

Jahia needs a specific project structure in order to create templates. There exists a maven archetype that creates that structure for you through the following command:

mvn archetype:generate -DarchetypeCatalog=http://maven.jahia.org/maven2

This command creates a folder structure needed by Jahia to upload a template set.

project
    -pom.xml
   -src
   -main
   -java
   -resources
      -jahiatemplates
         -myBoundle.properties
   -webapp
      -definitions.cnd
      -home.jsp
      -rules.dsrl
      -skins
      -theme
      -WEB-INF
         -templates.xml
         -web.xml

  1. The file templates.xml defines and describes templates of the current template set. For example:


    <templates default="home" homepage="Home">
       <template name="home" display-name="Home page" filename="home.jsp" page-type="my_templates:home"/>
    </templates>

  2. The file definitions.cnd describes content definitions. The following is an example of the content of this file:


    [my_templates:logoContainer] > jnt:container
       file logoImage (file[mime='image/*'])

    [my_templates:navigation] mixin
       containerList navLink (jnt:navLink)

    [my_templates:genericText] > jnt:container
       bigText insertText

    [my_templates:home] > jnt:page, my_templates:navigation
       singleContainer logo (my_templates:logoContainer)
       singleContainer pageBodyText (my_templates:genericText)


    Notice that we are defining a page that is going to have navigation, a logo container and html container.
  3. After defining the above page structure, we need to create a jsp file named home.jsp in order to define this template layout. Here we need to write all the necessary html and use Jahia tags in order to display the editable fields of the page.
    Every page needs to have the following structure:

    <template:template>
       <template:templateHead>
          Content that is going to appear in the <head> html section
       </template:templateHead>
       <template:templateBody>
           Content that is going to appear in the <body> html section
       </template:templateBody>
    </template:template>
  4. Jahia identifies the elements defined in the .cnd file by name. So in order to include a list or a single container to a jsp we need to use the same name defined in the cnd file. For example:

    (Use of the logo container in home.jsp)
    <template:absoluteContainerList name="logo" id="logoSingleContainer" pageLevel="1">
       <template:container>
          <a href='<template:composePageURL pageID="${requestScope.currentSite.homepageID}"/>'><template:image file="logo" cssClassName="headerImages"/></a>
       </template:container>
    </template:absoluteContainerList>

    (Use of page body text container in home.jsp)
    <template:containerList name="pageBodyText" id = "pageBodyTextList">
       <template:container>
          <template:field name="insertText" display="true"/>
    </template:container>
    </template:containerList>


    The main difference between the absoluteContainerList and containerList is that the absolute container list defines a page level where containers are going to be filled.
  5. To use Jahia navigation we just need to use the tag . This tag builds the structure <ul><li><a href="">item</a></li></ul>

    (Example of Main Navigation)
    <ui:navigationMenu displayActionMenuBeforeLink="true" cssClassName=""
    mockupClass="mockup-hmenu" kind="topTabs" requiredTitle="true"
    usePageIdForCacheKey="true"/>

    The look and feel of the navigation needs to be done using style sheets. Or if you do not want to use the standard html created by this tag, you can personalize it assigning a var attribute to this tag and personalize it.
ajax rotator
Recent Posts

RSS feeds
Tag cloud
frontend optimization lead management web marketing for dummies google search appliance reddot white paper multisite asp Velocity website design los angeles CMS usability html content mangement optimization facebook developers cloud content management whitepaper LDAP VS2010 APC sitecore devices inbound marketing Ubuntu Server E-commerce development keywords cms los angeles online marketing Sharepoint IIS google architecture oshyn Business Users deployment template design web marketing WCM Design Patterns jahia wcm search suggest licencing cloud computing memcache Jahia google analytics release management MVC thoughts LiveServer Web development Solr open source sitecore email campaign manager social network Navigation Visual Basic javascript linux higher education geographical wcm CMS Training performance profile box reddot cms higher education JSR-168 HubSpot url CRM keyword selection plugin tuckey CTA social 2.0 tools AS3 php5 portlets VB ubuntu theming drools jsp sitecore oms scalability sales 2.0 enterprise Active Directory google maps LS geo iphone open text cms open text tuning web services open-source web2.0 ASP.NET MVC opentext liferay data access VPP print css modules target dynament communicating Ubercart content management systems Visual Studio reddot cms cms whitepaper software design sitecore meetup ui Flash project management social media web development los angeles Marketing Automation php ASP.NET web3.0 templating open text delivery server friendly url rdbs Delivery Server reddot EPiServer sitecore online marketing suite, online marketing suite consulting reddot whitepaper web evolution Live Server cms white paper mobile IT Investment content management los angeles .net Sitecore configuration management content authoring search engine dynament concrete5 missing images content authors webcomponent sitecore user group mashups mashup mashware profile tab web content management jahia cms integration CMS facebook foursquare icefaces open text liveserver ajax Maven SEO google appEngine Drupal web design los angeles patterns ajax push cookie-free domain boost ipc spatial content management white paper postgis RFP portal facebook app, OS 3.0, three20 Database twitter management reddot higher education presentation layer web design new sites campaigns cms los angeles, content management los angeles, web development los angeles, website design los angeles, web design los angeles, sitecore meetup, sitecore user group sitecore layout lucene jquery, jquery plugin GIS design patterns jquery industry challenges cluster editing content mysql GSA fbml SMM java multilingual EPiServer Active Directory design Actionscript 3 drush Acquia OO Development open text management server open text web solutions call to action redundant database structure sitecore ECM code design Sitecore Active Directory Dynamic Data oms command line lead generation location marketing
2010 Copyright Oshyn. All rights reserved.