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.
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?
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)
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.
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.
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
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
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)
Hmm ok so that bug is still alive..I'll go check codeplex to see the status of this.
/Jan
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
Hi,
I'm getting the same issue.
Any information on how can i fix with razor would be greatly appreaciated.
Matt
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
is working on a reply...