Dear Wiki user, You have subscribed to a wiki page or wiki category on "Lenya Wiki" for change notification.
The following page has been changed by Doug Chestnut: http://wiki.apache.org/lenya/HowToXHTMLTemplating The comment on the change is: stylesheet was not working, seems to work now ------------------------------------------------------------------------------ Your template could look something like this (taken from the default pub) {{{ - <html> + <html xmlns="http://www.w3.org/1999/xhtml"> <head> <link rel="stylesheet" href="/css/page.css" type="text/css"/> <meta content="Apache Lenya" name="generator"/> @@ -96, +96 @@ xmlns:page="http://apache.org/cocoon/lenya/cms-page/1.0" xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:dcterms="http://purl.org/dc/terms/" + xmlns:i18n="http://apache.org/cocoon/i18n/2.1" - exclude-result-prefixes="page xhtml dc lenya" + exclude-result-prefixes="page xhtml" > <!-- {context-prefix}/{publication-id}/{area} --> <xsl:param name="root"/> + <xsl:param name="document-id"/> + <!-- i.e. doctypes/xhtml-document --> - <xsl:param name="document-id"/> + <xsl:param name="document-type"/> <!-- The rquest url i.e. /lenya/doctypes/xhtml-document_en.html --> <xsl:param name="url"/> + + <xsl:param name="language"/> <xsl:template match="cmsbody"> <xsl:apply-templates select="xhtml:html"/> @@ -153, +159 @@ </xsl:copy> </xsl:template> - <xsl:template match="xhtml:[EMAIL PROTECTED]'tabs']"> + <xsl:template match="xhtml:[EMAIL PROTECTED]'tabs' and ancestor::xhtml:html]"> - <xsl:apply-templates select="/cmsbody/xhtml:[EMAIL PROTECTED] = 'tabs']"/> + <xsl:apply-templates select="/cmsbody/xhtml:[EMAIL PROTECTED] = 'tabs']"/> </xsl:template> - <xsl:template match="xhtml:[EMAIL PROTECTED]'breadcrumb']"> + <xsl:template match="xhtml:[EMAIL PROTECTED]'breadcrumb' and ancestor::xhtml:html]"> <xsl:apply-templates select="/cmsbody/xhtml:[EMAIL PROTECTED] = 'breadcrumb']"/> </xsl:template> - <xsl:template match="xhtml:[EMAIL PROTECTED]'search']"> + <xsl:template match="xhtml:[EMAIL PROTECTED]'search' and ancestor::xhtml:html]"> <xsl:apply-templates select="/cmsbody/xhtml:[EMAIL PROTECTED] = 'search']"/> </xsl:template> - <xsl:template match="xhtml:[EMAIL PROTECTED]'body']"> + <xsl:template match="xhtml:[EMAIL PROTECTED]'body' and ancestor::xhtml:html]"> <xsl:copy> <xsl:apply-templates select="@*"/> <xsl:apply-templates select="/cmsbody/xhtml:[EMAIL PROTECTED] = 'body']"/> </xsl:copy> </xsl:template> - <xsl:template match="xhtml:[EMAIL PROTECTED]'modified']"> + <xsl:template match="xhtml:[EMAIL PROTECTED]'modified' and ancestor::xhtml:html]"> <xsl:apply-templates select="/cmsbody/lenya:meta/dcterms:modified"/> </xsl:template> - <xsl:template match="xhtml:[EMAIL PROTECTED]'publisher']"> + <xsl:template match="xhtml:[EMAIL PROTECTED]'publisher' and ancestor::xhtml:html]"> <xsl:apply-templates select="/cmsbody/lenya:meta/dc:publisher"/> </xsl:template> - <!-- identity template --> + <xsl:template match="dcterms:modified"> + <xsl:variable name="date"><xsl:value-of select="."/></xsl:variable> + <i18n:text>last_published</i18n:text>: + <xsl:if test="$date!=''"> + <i18n:date-time src-pattern="yyyy-MM-dd HH:mm:ss" pattern="EEE, d MMM yyyy HH:mm:ss z" value="{$date} + "/> + </xsl:if> + </xsl:template> + + <xsl:template match="dc:publisher"> + <xsl:variable name="user"><xsl:value-of select="."/></xsl:variable> + <xsl:variable name="user-id"><xsl:value-of select="substring-before($user,'|')"/></xsl:variable> + <xsl:variable name="rest"><xsl:value-of select="substring-after($user,'|')"/></xsl:variable> + <xsl:variable name="user-name"><xsl:value-of select="substring-before($rest,'|')"/></xsl:variable> + <xsl:variable name="user-email"><xsl:value-of select="substring-after($rest,'|')"/></xsl:variable> + + <xsl:if test="$user != ''"> + <xsl:choose> + <xsl:when test="$user-email != ''"> + / <a> + <xsl:attribute name="href"><xsl:value-of select="concat('mailto:',$user-email)"/></xsl:attribut + e> + <xsl:value-of select="$user-name"/> + </a> + </xsl:when> + <xsl:otherwise> + / <xsl:value-of select="$user-name"/> + </xsl:otherwise> + </xsl:choose> + </xsl:if> + </xsl:template> + <xsl:template match="@*|node()" priority="-1"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template> - </xsl:stylesheet> }}} --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
