Tech
TechPeter LamutHow to change element's ID with Diazo?
A common scenario: on your website all subpages share a common header, but you want a different header on the front page. Let's say you differentiate...
<!-- change header's ID attribute -->
<prepend css:theme="#header-index">
<xsl:attribute name="id">header-subpage</xsl:attribute>
</prepend>
ID of the header as defined in theme file (header-index) is changed to header-subpage after the rule above is applied.
The rule basically says “Match #header-index element in theme file and use some inline XSL on it”. The “xsl:attribute” tag matches current element’s attribute whose name is “id” (with “current element” being the #header-index element as matched by the outer
Peter Lamut
Peter was one of the original co-founders of Niteo and the main developer on our early projects.


