stk:head.create-js(template)

Used to render script elements for all Javascript files for the current device as defined in the theme.xml.

element()*stk:head.create-js
  1. xs:stringplacement

Examples

Input

<head>
    <!-- rest of head... -->
    <xsl:call-template name="stk:head.create-js">
        <xsl:with-param name="placement" select="'head'"/>
    </xsl:call-template>
</head>
<body>
    <!-- rest of body... -->
    <xsl:call-template name="stk:head.create-js">
        <xsl:with-param name="placement" select="'body'"/>
    </xsl:call-template>
</body>

Input

<!-- In theme.xml -->
<theme>
    <device-classes>
        <device-class name="desktop,unknown">
            <scripts>
                <script>
                    <path>{theme}main.js</path>
                </script>
                <script>
                    <path>{theme}html5shiv.js</path>
                    <placement>head</placement>
                </script>
            </scripts>
        </device-class>
    </device-classes>
</theme>

Parameters

placement
Used to differentiate between resources placed in head and resources placed in body.
Type
xs:string
Default
body