Basically I'm wanting to let the client enter in their email within the "Text String" property within the front end of umbraco.
Example: if they enter [email protected] my xslt needs to pick up the entered text and if a user clicks on the email link on the live site it will trigger the mailto function.
Here is what I have so far
I imagine I have done something wrong with the "href" section of the anchor.
I am not sure on the functionality you are trying to build, but the href needs to be either wrapped in curly brackets, or as follows (I like this option as I find it easier to decipher later on, albeit a more verbose way of coding)
I tried what you suggested and this broke my code unfortunately... "error parsing xlst..."
What I am building is a listPeople function... the user creates a group of people and then individual persons. I need the site to spit out the list of people within a UL which it currently does - just having a hard time with the email going into the href as a mailto.
Value was either too large or too small for an Int32. Value was either too large or too small for an Int32. at System.Convert.ToInt32(Double value) at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider) at System.Xml.Xsl.Runtime.XmlQueryRuntime.ChangeTypeXsltArgument(XmlQueryType xmlType, Object value, Type destinationType) at System.Xml.Xsl.Runtime.XmlQueryContext.InvokeXsltLateBoundFunction(String name, String namespaceUri, IList`1[] args) at System.Xml.Xsl.CompiledQuery.Query.(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current, Double {urn:schemas-microsoft-com:xslt-debug}position, Double {urn:schemas-microsoft-com:xslt-debug}last, IList`1 {urn:schemas-microsoft-com:xslt-debug}namespaces) in C:\Inetpub\powermarketing.co.nz\xslt\listPeople.xslt:line 34 at System.Xml.Xsl.CompiledQuery.Query.(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator , Double , Double ) at System.Xml.Xsl.CompiledQuery.Query.Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime) at System.Xml.Xsl.CompiledQuery.Query.Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime) at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer) at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, TextWriter results) at umbraco.macro.GetXsltTransformResult(XmlDocument macroXML, XslCompiledTransform xslt, Dictionary`2 parameters) at umbraco.macro.loadMacroXSLT(macro macro, MacroModel model, Hashtable pageElements)
XSLT Niceurl mailto
Hi Guys,
Basically I'm wanting to let the client enter in their email within the "Text String" property within the front end of umbraco.
Example: if they enter [email protected] my xslt needs to pick up the entered text and if a user clicks on the email link on the live site it will trigger the mailto function.
Here is what I have so far
I imagine I have done something wrong with the "href" section of the anchor.
All suggestions welcome!
Hi Jordy
I am not sure on the functionality you are trying to build, but the href needs to be either wrapped in curly brackets, or as follows (I like this option as I find it easier to decipher later on, albeit a more verbose way of coding)
As stated above, I am not sure on the exact functionality you are building, but hopefully this will help progress things for you.
Nigel
Hi Nigel,
I tried what you suggested and this broke my code unfortunately... "error parsing xlst..."
What I am building is a listPeople function... the user creates a group of people and then individual persons. I need the site to spit out the list of people within a UL which it currently does - just having a hard time with the email going into the href as a mailto.
Add "?umbDebugShowTrace=true" on your page to determine the cause of the error and paste error in forum.
Probably also a good idea to post your code as well, but not as an image as you can't copy/paste then..
Nigel
This is the error:
Value was either too large or too small for an Int32.
at System.Convert.ToInt32(Double value)
at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
at System.Xml.Xsl.Runtime.XmlQueryRuntime.ChangeTypeXsltArgument(XmlQueryType xmlType, Object value, Type destinationType)
at System.Xml.Xsl.Runtime.XmlQueryContext.InvokeXsltLateBoundFunction(String name, String namespaceUri, IList`1[] args)
at System.Xml.Xsl.CompiledQuery.Query.(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current, Double {urn:schemas-microsoft-com:xslt-debug}position, Double {urn:schemas-microsoft-com:xslt-debug}last, IList`1 {urn:schemas-microsoft-com:xslt-debug}namespaces) in C:\Inetpub\powermarketing.co.nz\xslt\listPeople.xslt:line 34
at System.Xml.Xsl.CompiledQuery.Query.(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator , Double , Double )
at System.Xml.Xsl.CompiledQuery.Query.Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
at System.Xml.Xsl.CompiledQuery.Query.Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer)
at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, TextWriter results)
at umbraco.macro.GetXsltTransformResult(XmlDocument macroXML, XslCompiledTransform xslt, Dictionary`2 parameters)
at umbraco.macro.loadMacroXSLT(macro macro, MacroModel model, Hashtable pageElements)
Here is my code:
xsl:stylesheet [ ]>
<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"
exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets ">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<xsl:template match="/">
<ul id="list-people">
<xsl:for-each select="$currentPage/Person">
<li class="clearfix">
<div class="person-image">
<xsl:if test="personImage > 0">
<xsl:variable name="img" select="umbraco.library:GetMedia(personImage, 0)" />
<xsl:variable name="imgPath" select="concat(substring-before($img/umbracoFile,'.'), '.jpg')" />
<img class="person-image" src="{$imgPath}" width="140" height="130" alt="{@nodeName}" />
xsl:if>
div>
<div class="person-info">
<span><xsl:value-of select="@nodeName" />span>
<span><xsl:value-of select="personJobTitle" />span>
<p><xsl:value-of select="personDescription" />p>
<a>
<xsl:attribute name="href">
<xsl:value-of select="umbraco.library:NiceUrl(@ID)"/>
xsl:attribute>
<xsl:value-of select="personEmail"/>
a>
div>
li>
xsl:for-each>
ul>
xsl:template>
xsl:stylesheet>
Fixed it!!!
This is what I was after:
<a href="mailto:{personEmail}"><xsl:value-of select="personEmail" /></a>
is working on a reply...