[opencms-dev] Properties template and template-elements

Mathias Lin mail at mathiaslin.com
Sun Mar 28 05:46:14 CEST 2010


I have a similar understand about template and template-elements as Paul. For
small sites though I sometimes only use template-elements and no template,
if not necessary.

Using template property is good if you need to support different
theming/layout of the master template (surrounding outer template) and it
cannot solely be done with different css, while the content section
basically remains the same.

@Tim: better to open a new thread with new subject line than capturing an
existing one if the question is different (even if the topics are related).

Regards,
Mathias


Paul-Inge Flakstad wrote:
> 
> 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
> 
> 


-----
Mathias Lin
Skype: mathias.lin
http://www.mathiaslin.com
-- 
View this message in context: http://old.nabble.com/Template-property-wiped-when-using-Internet-Explorer-tp28030033p28057057.html
Sent from the OpenCMS - Dev mailing list archive at Nabble.com.




More information about the opencms-dev mailing list