Tuesday, August 10, 2010

OFBiz Tutorials - Static Pages with CMS

OFBiz tutorials 3 part series that will demonstrate how the OFBiz Content Management System (CMS) can be used for front end application static pages. We will do this using a simple content data setup on a screen. The purpose of this exercise is to give clients the ability to change text on static pages at any time without having to get into code changes. This feature is especially helpful on enterprise eCommerce websites that feature pages like "About Us", "FAQ's", etc.

All of the details in this OFBiz tutorial are supported out-of-the-box (OOTB) with OFBiz CMS implementation.

CMS for Front End Static Pages With CMS | OFBiz Tutorial

Topics:
  • Understand basics of DataResource and Content Record.
  • Setup of content data for embedding FTL markup.
  • Setup of a content driven screen to show the static content setup.
We are assuming that a component is already set-up. In this exercise we are using "cmsdemo"for the component.

DataResource / Content records | OFBiz Tutorials

Our goal in this exercise is to define the following content "This is the text that will appear on screen".

The first step is to define a "DataResource" that will represent the text. Defining in DataResource allows greater flexibility because of the ability to store long texts in the "textdata" field. Prior to rendering, all FTL markups using the "dataTemplateTypeId" attribute need to be made. This allows Freemarker instructions to execute before the screen is rendered.

Setup the following data in a data file

(go to http://www.hotwaxmedia.com/apache-ofbiz-blog/category/ofbiz/page/17/ for code definitions)

Now we'll create a Content Record. This will be associated to the DataReasource. The Content Record is the same regardless of the DataResource that has been chosen.

Using the following directive, we'll include the content inside the section of screen definition.

(go to http://www.hotwaxmedia.com/apache-ofbiz-blog/category/ofbiz/page/17/ for code definitions)

Ensure that there is an ofbiz-component file for the CMS data file that we created earlier.

(go to http://www.hotwaxmedia.com/apache-ofbiz-blog/category/ofbiz/page/17/ for code definitions)

Now we'll ensure we have "Main Request" and "View" defined in the controller file

(go to http://www.hotwaxmedia.com/apache-ofbiz-blog/category/ofbiz/page/17/ for code definitions)

Once the request for [https://localhost:8443/cmsdemo/control/main] is served, a page will be visible that displays the text "CMS Demo, This is the text that will appear on screen".

Over the next few posts we'll expand on the capabilities that we've touched on here.

Enterprise eCommerce is a vast marketplace with unlimited potential for businesses to reach customers. By using Apache Open For Business (OFBiz), you'll have greater control and increased flexibility when it comes to your eCommerce website. This translates to reduced cost for software and support costs and a more streamlined enterprise eCommerce interface.

No comments:

Post a Comment