Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Lee 1130 posts 3088 karma points
    Jul 17, 2009 @ 13:55
    Lee
    0

    Can't Get NiceUrl To Take A Macro Parameter?

    I really thought this was an easy one, but just cannot get it to take the parameter?

    <xsl:value-of select="umbraco.library:NiceUrl('[#TheNodeID]')"/>

    Its returning an error

    System.OverflowException: Value was either too large or too small for an Int32.
       at System.Convert.ToInt32(Double value)
       at System.Double.System.IConvertible.ToInt32(IFormatProvider provider

    Any pointers appreciated.. I tried casting it to an integer like integer() but it doesn't recognise that?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jul 17, 2009 @ 14:05
    Jan Skovgaard
    100

    I don't think you are allowed to do it like that.

    I am not sure if this will work but how about creating a variable to hold the value from the macro?

    Try writing something like this

    <xsl:variable name="urlId" select="/macro/TheNodeId"/>
    <xsl:value-of select="umbraco.library:NiceUrl($urlId)"/>

    Does this help?

    /Jan

  • Lee 1130 posts 3088 karma points
    Jul 17, 2009 @ 14:23
    Lee
    0

    Legend thanks.... Will use this way in the future :)

    Thought it wasn't working but realised I was being a plank - And had different letter casing on my variables!!

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jul 17, 2009 @ 14:39
    Jan Skovgaard
    0

    Happy you got it working :)

Please Sign in or register to post replies

Write your reply to:

Draft