Skip to main content

Posts

Showing posts from September, 2012

Umbraco, XSLT, Display a Linked Email, Mailto in a Template from a Field in a DocType

The example below shows you how to display a linked/mailto email address in an Umbraco Template using insertTextBefore and insertTextAfter.

  <p><strong>Email Address:</strong>
<umbraco:Item field="emailAddess" insertTextBefore="&lt;a href=&quot;mailto:" insertTextAfter="&quot;&gt;" runat="server"></umbraco:Item>
  <umbraco:Item field="emailAddess" insertTextBefore="" insertTextAfter="&lt;/a&gt;" runat="server"></umbraco:Item>
  </p>

Umbraco = XSLT - Site Map - Exclude Certain Doctypes from Site Map

The example XSLT below shows you how to exclude certain nodes, based on their document type.  The important bit is highlighted.

This is done by modifying the built in XSLT Site Map that comes with Umbraco, just replace the DocType numbers in the highlighted section to get this to work.


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
<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" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets=&quo…

Umbraco - XSLT - List Sub Pages from a Specific Node, by Node Id

The following Umbraco XSLT list all sub pages from a specific Node using node ID.  The important bit is Highlighted.  

1)  umbraco.library:GetXmlNodeById(1062) <-- list all sub pages of nodeId 62.

2) You could replace this line above with something like this: umbraco.library:GetXmlNodeById($currentPage/chooseSubPagesToList)

and in your DocType, there would be a contentPicker called 'chooseSubPagesToList.


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
<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" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Ex…