Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I found this post
http://our.umbraco.org/wiki/how-tos/create-canonical-urls-using-xslt-macro
And tried to use the XSLT there by copying and pasting it. Umbraco wont allow me to save it. Does anybody know why? THis is the XSLT:
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE xsl:Stylesheet [ <!ENTITY nbsp " "> ]><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxml="urn:schemas-microsoft-com:xslt" xmlns:umbraco.library="urn:umbraco.library" exclude-result-prefixes="msxml umbraco.library"> <xsl:output method="xml" omit-xml-declaration="yes"/> <xsl:param name="currentPage"/> <xsl:template match="/"> <xsl:choose> <xsl:when test="starts-with(umbraco.library:RequestServerVariables('HTTP_HOST'),'www')"> <xsl:variable name="url" select="concat('http://',umbraco.library:RequestServerVariables('HTTP_HOST'))" /> <link rel="canonical" href="{$url}{umbraco.library:NiceUrl($currentPage/@id)}" /> </xsl:when> <xsl:otherwise> <xsl:variable name="url" select="concat('http://www.',umbraco.library:RequestServerVariables('HTTP_HOST'))" /> <link rel="canonical" href="{$url}{umbraco.library:NiceUrl($currentPage/@id)}" /> </xsl:otherwise> </xsl:choose> </xsl:template></xsl:stylesheet>
Its ok , I sorted it . If I have "test this xslt" ticked.. it doesnt allow me to save.. as long as its unticked it works fine and saves.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Canonical tags
I found this post
http://our.umbraco.org/wiki/how-tos/create-canonical-urls-using-xslt-macro
And tried to use the XSLT there by copying and pasting it. Umbraco wont allow me to save it. Does anybody know why? THis is the XSLT:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:Stylesheet [ <!ENTITY nbsp " "> ]>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxml="urn:schemas-microsoft-com:xslt"
xmlns:umbraco.library="urn:umbraco.library"
exclude-result-prefixes="msxml umbraco.library">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<xsl:template match="/">
<xsl:choose>
<xsl:when test="starts-with(umbraco.library:RequestServerVariables('HTTP_HOST'),'www')">
<xsl:variable name="url" select="concat('http://',umbraco.library:RequestServerVariables('HTTP_HOST'))" />
<link rel="canonical" href="{$url}{umbraco.library:NiceUrl($currentPage/@id)}" />
</xsl:when>
<xsl:otherwise>
<xsl:variable name="url" select="concat('http://www.',umbraco.library:RequestServerVariables('HTTP_HOST'))" />
<link rel="canonical" href="{$url}{umbraco.library:NiceUrl($currentPage/@id)}" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
Its ok , I sorted it . If I have "test this xslt" ticked.. it doesnt allow me to save.. as long as its unticked it works fine and saves.
is working on a reply...