Formatting of embedded head section declared in smartsite.config

This specific format macro takes the datatable from {embed.headsection()} as its input and adds all script includes, inline scripts, style includes and inline style to the head section of the current page.

XML CopyCode image Copy Code
<add macro="embed.includeheadsection" inherit="format"
     description="Adds relevant elements from the head section of an embedded page to the placeholders defined above.">
    <set parameter="format" overridable="false">
        <![CDATA[
            <se:rowformat expression="this.field('TagName')=='script' AND this.field('URL')!=''">
                {placeholder.addjavascriptinclude(this.field('URL'), ((this.field('Extra')!='') AND (convert.toboolean(string.isempty(this.field('Extra'),'false')))))}
            </se:rowformat>
            <se:rowformat expression="this.field('TagName')=='script' AND this.field('URL')==''">
                {placeholder.addjavascript(this.field('Data'))}
            </se:rowformat>
            <se:rowformat expression="this.field('TagName')=='link' AND this.field('Rel')=='stylesheet'">
                {placeholder.addcssinclude(this.field('URL'), this.field('Extra'))}
            </se:rowformat>
            <se:rowformat expression="this.field('TagName')=='style'">
                {placeholder.addcss(this.field('Data'))}
            </se:rowformat>
        ]]>
    </set>
</add>