SOCIB RAMADDA Data Repository
HTML Page Templates
Previous: Service Integration Framework Next: Admin Settings Table of contents
RAMADDA User Guide
 
14.6 HTML Page Templates
The HTML pages that RAMADDA generates are based on a template mechanism. Here is an example template that has documentation in it: exampletemplate.html.txt. Copy the example to your local RAMADDA plugins directory and rename it as: <your name>template.html (strip off the .txt):
<user home>/.ramadda/plugins/somenametemplate.html
Any plugin file that ends with "template.html" is loaded by RAMADDA as a template.

In the template are a set of properties. You should change the id and name property. There are a number of other macros shown as ${macro} that are used to instantiate a web page. See the above example template for more information.

You can see many examples of templates at the at the SourceForge SVN site.

14.6.0 Packaging your template
While you can just have a file called <something>template.html in your plugins directory if you have your own CSS or images or icons that go along with your template you will want to package them up in a .jar file. Here is an example exampletemplate.jar that provides the above exampletemplate.html.

This file was created from a directory tree:

exampletemplate
       exampletemplate.html
       htdocs
            exampletemplate
                 template.css
                 banner.jpg
The jar file is created with:
mac:jar -Mcvf exampletemplate.jar  exampletemplate
adding: exampletemplate/(in = 0) (out= 0)(stored 0%)
adding: exampletemplate/exampletemplate.html(in = 1406) (out= 595)(deflated 57%)
adding: exampletemplate/htdocs/(in = 0) (out= 0)(stored 0%)
adding: exampletemplate/htdocs/exampletemplate/(in = 0) (out= 0)(stored 0%)
adding: exampletemplate/htdocs/exampletemplate/banner.jpg(in = 55020) (out= 52006)(deflated 5%)
adding: exampletemplate/htdocs/exampletemplate/template.css(in = 3680) (out= 1139)(deflated 69%)
Note: if you don't have jar installed (it is part of the Java release) then you can just zip the file and call it something.jar.

The template.css and banner.jpg files are in a directory (exampletemplate) under the htdocs directory so they can be referenced in the html as:

<link href="${root}/exampletemplate/template.css" rel="stylesheet" type="text/css" media="screen">
14.6.1 Specifying a Default Template
You can specify a default template for your site in 2 ways. First, go to the Admin->Users list and edit the anonynmous user. Select the desired template from the list. You can also specify the default template for the site via a property:
ramadda.html.template.default=<your template id>
You can set this in a plugin .properties file or you can specify this property (and other properties as well) in the Admin->Settings->Site and Contact Information->Extra Properties field.
14.6.2 Miscellaneous
You can specify whether the "Created:" label is shown for entries with the property:
#default:
ramadda.created.display=all  

#never show it
ramadda.created.display=none  

#only show it for admins
ramadda.created.display=admin

#only show it for logged in users
ramadda.created.display=user

 

Previous: Service Integration Framework Next: Admin Settings Table of contents

Powered by Geode Systems and RAMADDA