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

Eska sven.kiesow at interone.de
Wed Dec 2 10:41:57 CET 2009


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-gallery.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-html-head-section-in-a-template-tp26605810p26606151.html
Sent from the OpenCMS - Dev mailing list archive at Nabble.com.




More information about the opencms-dev mailing list