Ubuntu OpenCMS Template Pg2 PDF Print E-mail


How we implemented the MVC Design Pattern

 Two Special templates were developed :

  1. The Controller Template (This is an implementation  FascadeDesign Pattern) wraps / interfaces the OpenCMS API
  2. The Model Template calls the above template and manages the data for your web page
Now your template becomes the View and all you focus on is the HTLM aspects of your page being delivered

This Framework will be revised soon so please visit this site in a few weeks for an anouncement

How to install the Ubuntu Module

 Module Instalation

  • In the Module Management use the Import Module options to get your module in
  • Make sure that the following path was

created : /sites/default/Special_Resources/UbuntuTemplates

Setting up Site Specific Content and Image Pointer URL's

 

  • In the folder /sites/default/Special_Resources/UbuntuTemplates
  • Replace the images with your own artwork .
  • Edit source of PageData.jsp change values in first method setupData() (Your Site *Specific Content Pointers ) .
  • Here you have the flexibility to change your image content pointers , email addresses , Web Site Name , Site Specific messages and URL's
  • After editing save and publish PageData.jsp

Touch the Content Delivery templates to force them to be Re-compiled

  • In the folder /system/modules/ubuntu........... you will find a templates folder
  • Edit source of all the -A_Ubuntt........ templates (just change the version numbers or version dates)
  • Save and publish these templates
  • Now you are ready to use them

For Multi-Site use

  • In the folder : /sites/default/Special_Resources/UbuntuTemplates create a subfolder for each site
  • Copy the content of the above folder there
  • Repeat steps 3 to 6 for each site (subfolder)
  • In the folder /system/modules/ubuntu........... you will find a templates folder
  • Copy these templates to files with suitable filenames for each site (I replace the word Ubuntu with Site Name)
  • Change the include directive to point to the new PageData.jsp templates for each site <@include file="site/default....yourSiteFolder/PageData.jsp>
  • Save and publish these templates

 How to re-use a template to make a new one

 

All the "Page Delivery" templates only have :

  • HTML tags
  • No Java code
  • and a few <%=templateData.requiredFrameworkMethod() %> scriptlets

A few usefull scriptlets we deveopped:

  • <%=templateData.getMenu() %> this places a menu inside a table
  • <%=templateData.getBannerTags() %> this puts an upper banner image on your page
  • <%=stbHCrumb.toString() %> This puts breadcrumbs on the page

This makes it easy to derive a template from another

suppose we took the following template:

 

<head>

<title><%=pageTitle %></title>

<cms:editable />

</head>

<body>

<table>

<tr>

<td colspan="2"><%=templateData.getBannerTags() %></td>

</tr>

<tr>

<td colspan="2"> </td>

</tr>

<tr>

<td><%=templateData.getMenu() %></td> <td><%=stbHCrumb.toString() %></td>

</tr>

<tr>

<td>

<table width="100%" border="0" cellspacing="0" cellpadding="0"> <%=templateData.getMenu() %> </table>

</td>

<td valign="top"><cms:include element="body" editable="true"/></td>

</tr>

</table>

</body>

And wanted to derive a second template without a Upper Banner and without a menu we would simply remove the elements from the above template Add new elements if we neede them and we would get a new template like this :

 

<head>

<title><%=pageTitle %></title>

<cms:editable />

</head>

<body>

<table>

<tr>

<td colspan="2"> </td>

</tr>

<tr>

<td><%=templateData.getMenu() %></td>

<td><%=stbHCrumb.toString() %></td>

</tr>

<tr>

<td> </td>

<td valign="top"><cms:include element="body" editable="true"/></td>

</tr>

</table>

</body> 

 

 

Last Updated ( Tuesday, 21 July 2009 )
 
Next >
Home