[opencms-dev] Dynamically creating the code for the html head section in a template

Paul-Inge Flakstad flakstad at npolar.no
Wed Dec 2 10:59:39 CET 2009


Hi Eska,

and thanks for replying. I will be using the property approach - thanks for re-assuring me that I was on the right track. :) In fact, I've already written a test template and it seems to be working fine.

Thanks,
Paul

> -----Original Message-----
> From: opencms-dev-bounces at opencms.org 
> [mailto:opencms-dev-bounces at opencms.org] On Behalf Of Eska
> Sent: 2. desember 2009 10:42
> To: opencms-dev at opencms.org
> Subject: Re: [opencms-dev] Dynamically creating the code for 
> the html head section in a template
> 
> 
> Hi Paul-Inge,
> 
> this screams for customizing the pages using a certain property.
> Your template could create the HTML source depending on 
> entries in that
> property.
> This is how I usually do stuff like that. Reading property 
> content also
> does not take too much time.
> 
> Eska
> 
> 
> Paul-Inge Flakstad wrote:
> > 
> > Hi list
> > 
> > In a custom template, I want to create some of the code for the HTML
> > <head> section dynamically.
> > 
> > For example, for some pages, I would like some specific code in the
> > <head>, like:
> > 
> > <!--[if IE]>
> > <link
> > 
> href="/system/modules/my.gallery.module/resources/style/IE-gal
lery.css"
> > rel="stylesheet" type="text/css" />
> > <![endif]-->
> > 
> > but for other pages I don't want it. The above is just a 
> really simple
> > example, it could be javascripts or whatever that one might want to
> > include for a single page, instead of globally. If you use 
> one global,
> > hard-coded template, you will often include unneccessary 
> javascripts,
> > stylesheets and so on.
> > 
> > I have an idea or two on how to achieve what I want (my 
> current choice:
> > storing <head> section snippets as text files, and using 
> properties to
> > include snippets where needed), but I would very much like 
> to hear from
> > anyone who's done something similar; how did you solve this?
> > 
> > Best regards,
> > Paul
> > 
> > 
> > _______________________________________________
> > This mail is sent to you from the opencms-dev mailing list
> > To change your list options, or to unsubscribe from the 
> list, please visit
> > http://lists.opencms.org/mailman/listinfo/opencms-dev
> > 
> 
> -- 
> View this message in context: 
> http://old.nabble.com/Dynamically-creating-the-code-for-the-ht
ml-head-section-in-a-template-tp26605810p26606151.html
> Sent from the OpenCMS - Dev mailing list archive at Nabble.com.
> 
> 
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, 
> please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev
> 


More information about the opencms-dev mailing list