Skip to main content

Posts

Showing posts from September, 2011

Complex XSLT Macro for embedding an I frame - using Paramaters

(http://forum.umbraco.org/yaf_postst4641_cant-embed-html-in-page.aspx)

Create a new macro and in it create 3 parameters "location", "width" and "height".
Check the "Use in editor" checkbox. Now create a xslt that looks something like this:


<?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"
    exclude-result-prefixes="msxml umbraco.library">


<xsl:output method="xml" omit-xml-declaration="yes"/>

<xsl:param name="currentPage"/>

<xsl:variable name="location" select="/macro/location"/>
<xsl:variable name="width" select="/macro/widt…

Simple XSLT Macro for embedding an I frame:

Simple XSLT Macro for embedding an I frame: 1) Create a New "Clean" xslt - ensure Create Macro is Ticked. 2) Where the XSLT reads: <!-- start writing XSLT --> - just paste in your IFRAME (highlighted below) 3) Go to the new Macro and tick "Use in Editor", this will allow it in the user drop down. <?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:Exs…

Umbraco - Using GetPreValueAsString to Return the String of a Field and not its value

If you have a field in Umbraco that is getting returned as a number instead of the name, see the highlighted text below.  1 - In a Macro . 2 - In a Template.

1.  IN A XSLT MACRO:

<?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="urn:Exslt.ExsltSets" xmlns:PS.XSLTsearch="urn:PS.XSLTsearch"
  exclude-result-pre…