BROKEN -OFBiz Tutorial – Using CMS for Front End Application Static Pages – Part-1‏

Mike BatesPublished: Updated:

In this post we will demonstrate OFBiz Content Management System usage for front end application static pages through simple content data setup and using it in a screen. This gives clients the flexibility to change the text to be shown on a static page when ever they want, without asking for any code change.

Take the example of an OFBiz e-commerce storefront web site.  Often times, clients will wish to include “static” pages like About Us, FAQ, and so on.  We want to empower the client to update this copy him/herself, without needing to request help from a programmer.  The following example gives us a simple look at how that is done.

All the details given here are supported by the out-of-the-box (OOTB) OFBiz CMS implementation.

In this exercise we will:

  • see the basic concept of DataResource and Content record.
  • setup content data to embed FTL markup.
  • setup a content driven screen and use it show the static content setup in data.

• Assumption: a component is already setup; here we using the name “cmsdemo” for component.

DataResource and Content records

Let’s suppose that we want to define content (that we will include in a screen) for the text “This is the text that will appear on screen.”.

Data Resource of type ELECTRONIC_TEXT

First of all we have to define a DataResource representing this text. This gives you greater flexibility because you can store long texts in the textData field. If you want to embed FTL markup (directives etc…) that needs to be processed before the rendering you can achieve this using the dataTemplateTypeId attribute, in this way all the Freemarker instructions in the text will be executed before rendering the screen. Following data needs to be setup in a data file:



Now we have to create a Content record that is associated to the DataResource. 
No matter what type of data resource you have choosen, the Content record is the same like:

Using the element in a screen definition.

Now we can easily include the content directly inside the section of the screen definition with the following directive:


Running the content driven screen


Load data created for static content

Make sure to have an entry in ofbiz-component file for the data file created for CMS date that we created earlier in the step.

or you can also load it through webtools –> XML Data Import.

Now make sure you have main request and view defined in your controller file:

When the request [https://localhost:8443/cmsdemo/control/main] is served you will see the following page that will show up the contents that you have setup in data:

ofbiz cms content management

This was a very basic example of OFBiz CMS capability.  We will expand on the details and demonstrate more OFBiz CMS functionality in upcoming posts.  If you need help with OFBiz CMS in the mean time, contact HotWax Media today!

– Pranay

Pranay Pandey is Manager, Enterprise Software Development at HotWax Media (OFBiz Service Provider) and has been involved with the OFBiz project since 2007. He contributes actively to OFBiz, and also trains HotWax Media developers in OFBiz techniques and best practices.

Mike Bates About Mike Bates
Mike Bates founded HotWax Systems in 1997 and is our chief executive. His career in web application sales, marketing, design and development spans two decades, and he is a long time open source software advocate. He has led high-profile web software projects for numerous national and global brands and has taught web development courses at the graduate level. Mike joins other HotWax employees and advisers in periodically posting thoughts here related to HotWax Commerce, OFBiz, digital commerce, and other topics.

Comments 3

  1. Avatar for Mike Bates

    Hi Pranay,
    Thanks for the informative articles on CMS.
    Referring to your articles OFBiz Tutorial – Using CMS for Front End Application Static Pages – Part-1, and
    I have two queries, viz.
    1. For content rendering in screen widget, instead of giving the CONTENT_ID directly, how can I access it using a variable, so that screen widget could be reused.

    2. If I use FTL for rendering CONTENT (Electronic text in HTML) instead of the screen widget, how do I prevent HTML tags from being escaped in FTL.


    1. Avatar for Mike Bates
  2. Avatar for Mike Bates

Leave a Reply

Your email address will not be published. Required fields are marked *