Copied to clipboard

Flag this post as spam?

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


  • Psib3r 70 posts 119 karma points
    Dec 08, 2011 @ 10:37
    Psib3r
    0

    macro parameters

    I have a strange bug where when putting the values into my macro parameters in text or multiline text if there uis more than 1 word it adds \n\r into the string.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Dec 08, 2011 @ 11:17
    Jan Skovgaard
    0

    Hi Psib3r

    What version of Umbraco are you using? This is an old bug, which I have encountered myself in older version of Umbraco (before 4.5)...I think it should be fixed by now?

    /Jan

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Dec 08, 2011 @ 11:24
    Jan Skovgaard
    0

    Oh...and btw you should be able to remove the unwanted characters by using the built in translate() function in XSLT for instance.

    You could for instance do something like (from the top of my head).

    <xsl:parameter name="myparam" select="/macro/youralias" />

    <xsl:variable name="cleanValue" select="translate($myparam,'\n\r')" />

    <xsl:value-of select="$cleanValue" />

    /Jan

  • Psib3r 70 posts 119 karma points
    Dec 08, 2011 @ 11:32
    Psib3r
    0

    Thanks, the macro is a .net user control, I will keep in mind what you have said for the future, my version is umbraco v 4.7.1 (Assembly version: 1.0.4281.20201)

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Dec 10, 2011 @ 09:59
    Jan Skovgaard
    0

    Hmm ok so that bug is still alive..I'll go check codeplex to see the status of this.

    /Jan

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Dec 10, 2011 @ 10:03
    Jan Skovgaard
    0

    Hi again

    Seems like this ticket is still open: http://umbraco.codeplex.com/workitem/23002

    You can vote it up and hopefully it will get fixed. I've experienced it in 1 solution all the time I've been working with Umbraco so it's likely an edge case. But it's a frustrating one indeed - but as mentioned above it can be worked around by removing those characters using code.

    /Jan

  • Matt Nolan 45 posts 65 karma points
    Jan 25, 2012 @ 18:31
    Matt Nolan
    0

    Hi,

    I'm getting the same issue.

    Any information on how can i fix with razor would be greatly appreaciated.

    Matt

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jan 28, 2012 @ 00:58
    Jan Skovgaard
    0

    Hi Matt

    I must admit that I'm still a bit of a Razor n00b myself...but I think this should perhaps do the trick.

    @Html.Raw(Html.Encode(Model.yourpropertyname).Replace("\n\r", ""))

    Hope this helps.

    /Jan

Please Sign in or register to post replies

Write your reply to:

Draft