Not sure how you are targetting it with string.Format but if you can pick it up can you a prefix and String.Replace('x','') and make your link x{0} or something along those lines?
Ive tried with whitespace but no luck.
I couldnt say why it is linking this way though, interesting to know, it seems to happen with any link that starts with a special character such as { , ! , @ etc..
The string format is used when i get the content from the RTE, in a APIController, before rendering the mail. The replace could work in simple cases, but potentially, the string could have x multiple places.
ah, ok, haven't tried with other characters, and yes, would be interesting to find out.
Ah I see, what I meant was not to replace the '/umbraco/' but a custom string and start the link with that.
So say the custom string you choose to use is 'foo' your link in would be:
'foo{0}{1}{2} '
(you will want to pick something very ungeneric..)
Then allow your code to either check for the full prefix 'foo'
Or a better solution may be that you know 'foo' is 3 characters and will always appear at the beginning, so you could trim off the first 3 characters and then do your string.Format?
Hmm, just ran into the same issue today. Why is it that link placeholders (like {url}) are prefixed with /umbraco/ ? And is that somehow possible to disable?
Note that when prefixing the placeholder with the scheme, like http://{url} the /umbraco/ prefix is not inserted. Don't really like to include explicit scheme references in my templates, though.
Inserting curly braces as link in rte
Hello
I'm trying to insert curly braces {0} in the RTE link.
The reason for that is that the RTE html is used in a mail template, where it gets replaced via string.format().
But when i insert, for some reason, umbraco changes the url from "{0}" to "/umbraco/{0}".
Is there a setting or something else i can set to avoid this?
Not sure how you are targetting it with string.Format but if you can pick it up can you a prefix and String.Replace('x','') and make your link x{0} or something along those lines?
Ive tried with whitespace but no luck.
I couldnt say why it is linking this way though, interesting to know, it seems to happen with any link that starts with a special character such as { , ! , @ etc..
The string format is used when i get the content from the RTE, in a APIController, before rendering the mail. The replace could work in simple cases, but potentially, the string could have x multiple places.
ah, ok, haven't tried with other characters, and yes, would be interesting to find out.
When you say the string can have x multiple places do you mean it may be {0}{1}{2} etc..?
Exactly, and the main text could potentially contain a "/umbraco/" that shouldn't be replaces
Ah I see, what I meant was not to replace the '/umbraco/' but a custom string and start the link with that.
So say the custom string you choose to use is 'foo' your link in would be:
'foo{0}{1}{2} '
(you will want to pick something very ungeneric..)
Then allow your code to either check for the full prefix 'foo'
Or a better solution may be that you know 'foo' is 3 characters and will always appear at the beginning, so you could trim off the first 3 characters and then do your string.Format?
M
Thanks Marc, sounds like a temporary solution.
I'll mark this as resolved at post it in the issues instead, thx again
Best of luck mate, let me know if you find a true solution!
Hmm, just ran into the same issue today. Why is it that link placeholders (like {url}) are prefixed with /umbraco/ ? And is that somehow possible to disable?
Note that when prefixing the placeholder with the scheme, like http://{url} the /umbraco/ prefix is not inserted. Don't really like to include explicit scheme references in my templates, though.
is working on a reply...