[opencms-dev] Properties template and template-elements

Paul-Inge Flakstad flakstad at npolar.no
Sat Mar 27 18:16:59 CET 2010


Hi Tim,

I went ahead and started a new subject, since my reply became quite lengthy.

I'm also confused about this. Understanding how these two properties work, or should work, has never been made completely clear to me. Until I gain a better understanding, I've landed on the following:

"template" is where I put the path to what I like to refer to as the "master template". The master template contains the <html><head>...</head> code and other common stuff, such as the header, navigation, language swappers, searchbox, footer and so on. I often split the master template into two elements, an upper and a lower element, using <cms:template element="...">.

"template-elements" is where I put the path to the template for the specific xmlcontent file. (For xmlcontent resources, OpenCms will look at this property for a path to a template. The property "template" is not used by OpenCms for xmlcontent.) This template's job is to generate the output of the xmlcontent file. But that's not the all it does. To make the template and the master template play well together, the first thing it does is include the upper part of the master template. Then it generates the output of the xmlcontent file. Finally, it includes the lower element of the master template. The path to the master template is of course read from the property.

As far as I can tell, this is similar to the way things work when you use resource types like the xmlpage ("Page with free text"), at least in terms of the end result - the specific mechanisms involved are quite different, I believe.

In addition to what I've explained above, I've also added more properties to allow dynamic inclusion of CSS, javascript and text snippets for the HTML <head> section. I'm not sure if this is the "correct" way to do things, but it certainly works very well on our sites, where nearly all files are structured content.

Would appreciate to hear more thoughts on this subject.

Best regards,
Paul

________________________________
From: opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.org] On Behalf Of Tim Daschner
Sent: 27. mars 2010 16:34
To: The OpenCms mailing list
Subject: Re: [opencms-dev] Template property wiped when using Internet Explorer

Gentlemen,

This is a slight aside from the main topic. I have always been confused between the property template and template-elements. I have tried reading documentation and also have referred the Liliedahl book on opencms 7, but somehow I am still confused. So, when does one use the template property and when does one use the template-element property? For now, all my templates are configured on the template-elements of my xmlcontent files, so I wonder what is the template property for?

Thanks!
Tim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20100327/4dca1c81/attachment.htm>


More information about the opencms-dev mailing list