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
Hi there,
I have an object for which I need it to retrieve the href parameter from a content picker.
I know that the code I need in order to get the URL is as follows:
umbraco.library:NiceUrl(number(./data [@alias = 'northRegionLink']))
But I am unsure how I would insert this in an (Rather complex - it is inside an image map) object's href.
Is it possible to create a macro and insert it inside the href declaration? If so, how would I do that?
Yes its possible to create a macro to retrieve this link.
to put it in your href you do just that.
<a href='<umbraco:macro alias="yourMacroName" source="[#northRegionLink]" runat="server" />'></a>
obviously you would need to create a Macro that accepts a parameter source and then do your usual Umbraco Library call to get the link back.
Okay, passing the value to the macro seems to be working fine, but how do I simply output the value of
umbraco.library:NiceUrl(linkNode)
where linkNode is my parameter?
I have ammended this to;
<xsl:value-of select="umbraco.library:NiceUrl(string(/macro/linkNode/node/id))"/>
However, I stil recieve a System.OverflowException;
System.OverflowException: Value was either too large or too small for an Int32.
just use a
<xsl:value-of select="umbraco.library:NiceUrl($linkNode)"/>
This assumes that you have created the variable for linkNode.
<xsl:variable name="linkNode" select="/macro/linkNode"/>
I still recieve the OverflowException.
Wrap the niceurl line with an xsl-if like this.
<xsl-if test="$linkNode !=''"><xsl:value-ofselect="umbraco.library:NiceUrl($linkNode)"/></xsl:if>
This should sort it for you.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Dynamically retrieving href for static object.
Hi there,
I have an object for which I need it to retrieve the href parameter from a content picker.
I know that the code I need in order to get the URL is as follows:
But I am unsure how I would insert this in an (Rather complex - it is inside an image map) object's href.
Is it possible to create a macro and insert it inside the href declaration? If so, how would I do that?
Yes its possible to create a macro to retrieve this link.
to put it in your href you do just that.
obviously you would need to create a Macro that accepts a parameter source and then do your usual Umbraco Library call to get the link back.
Okay, passing the value to the macro seems to be working fine, but how do I simply output the value of
where linkNode is my parameter?
I have ammended this to;
However, I stil recieve a System.OverflowException;
just use a
This assumes that you have created the variable for linkNode.
<xsl:variable name="linkNode" select="/macro/linkNode"/>
I still recieve the OverflowException.
Wrap the niceurl line with an xsl-if like this.
This should sort it for you.
is working on a reply...