<![CDATA[Article using headinclude tag.]]> In OpenCms 8 it is possibe to use additional javascript or css files to display a specific resource type. The paths to the additional files can be set inside of the resource type scheme. The referenced files are loaded dynamically, if the reource type is used on a container page.

To include the javascript or css files follow the inscructions:

  • Reference the javascript or css files inside of the resource type scheme using <headinclude> node.

Please compare:

/system/modules/org.opencms.dev.demo/schemas/article_with_headincludes.xsd

  • Use the javascript or css information inside of the formatter of the resource type.
  • Add following lines to the html <head> area of the template:

<cms:headincludes type="javascript" />
<cms:headincludes type="css" />

]]>