I apologise if this has already been asked, but I have spent the last hour searching and most of the posts seem to cover the old syntax and/or just doesn't seem to work.
I'm pretty new to Umbraco (usually work in Joomla / PHP), so this is all quite new and strange to me. :)
I've created an xslt file and macro to pull data from a content picker field into a 'read on' style button.
Here is my code;
<a class="small-btn blue rounded-1" href="{umbraco.library:NiceUrl($currentPage/readOnLink)}">Read on</a>
Works perfectly.
However, I need three of these, so I figured I'd simply rename the node readOnLinkOne and then repeat the process for each button (there is probably a much more elegant way, but this seemed simple).
So I changed the code to;
<a class="small-btn blue rounded-1" href="{umbraco.library:NiceUrl($currentPage/readOnLinkOne)}">Read on</a>
And now it doesn't work. I have changed the field aliases etc in the doctypes and in the templates to match the new code.
This is the error;
System.OverflowException: 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 (XmlQueryRuntime
{urn:schemas-microsoft-com:xslt-debug}runtime)
at Root(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.presentation.umbraco.developer.Xslt.xsltVisualize.visualizeDo_Click(Object
sender, EventArgs e)
I found a suggestion on here somewhere to add an if statement around it, like thus;
But, while it fixes the error, now the XLST doesn't generate any output.
Have I overlooked something? I tried looking through the documentation and at the tutorial videos, but again they seem to use the old syntax that no longer works.
I appreciate any help / suggestions / shoves in the right direction!
I assume you've renamed the property on the doctype for your content picker. For the XSLT to run against the XML cache (which is one of the many reasons for Umbraco's speed) you now have to re-save and publish the node in question, so that the underlying XML is updated.
NiceUrl system overflow exception
Hi all.
I apologise if this has already been asked, but I have spent the last hour searching and most of the posts seem to cover the old syntax and/or just doesn't seem to work.
I'm pretty new to Umbraco (usually work in Joomla / PHP), so this is all quite new and strange to me. :)
I've created an xslt file and macro to pull data from a content picker field into a 'read on' style button.
Here is my code;
Works perfectly.
However, I need three of these, so I figured I'd simply rename the node readOnLinkOne and then repeat the process for each button (there is probably a much more elegant way, but this seemed simple).
So I changed the code to;
<a class="small-btn blue rounded-1" href="{umbraco.library:NiceUrl($currentPage/readOnLinkOne)}">Read on</a>
And now it doesn't work. I have changed the field aliases etc in the doctypes and in the templates to match the new code.
This is the error;
I found a suggestion on here somewhere to add an if statement around it, like thus;
But, while it fixes the error, now the XLST doesn't generate any output.
Have I overlooked something? I tried looking through the documentation and at the tutorial videos, but again they seem to use the old syntax that no longer works.
I appreciate any help / suggestions / shoves in the right direction!
Thank you.
Hi Antony,
I assume you've renamed the property on the doctype for your content picker. For the XSLT to run against the XML cache (which is one of the many reasons for Umbraco's speed) you now have to re-save and publish the node in question, so that the underlying XML is updated.
HTH,
Benjamin
Ah. That makes sense. And now it also works perfectly.
Thank you very much, Benjamin.
is working on a reply...