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
Im trying to do the basic line break in multiline in a partial
umbraco.library.ReplaceLineBreaks
Like so:
@Html.Raw(umbraco.library.ReplaceLineBreaks(item.Value("citatet")))
but get an error
Compiler Error Message: CS0103: The name 'umbraco' does not exist in the current context
Has something changed in 8 or am i just missing something obvious?
umbraco.library is no longer available, I think you can use @(Html.ReplaceLineBreaksForHtml(item.Value("citatet"))) instead.
umbraco.library
@(Html.ReplaceLineBreaksForHtml(item.Value("citatet")))
As Sebastiaan says umbraco.library is no longer available or basically everything in umbraco namespace (notice the lowercase umbraco).
umbraco
Also in Umbraco v7 the umbraco.library is obsolete, where you can use Umbraco.ReplaceLineBreaks().
Umbraco.ReplaceLineBreaks()
In Umbraco v8 .ReplaceLineBreaks() method doesn't exists in UmbracoHelper, but is an Html extension method.
.ReplaceLineBreaks()
UmbracoHelper
Html
Thanks guys. Is there the documentation concerning the "Html" extension method anywhere?
I am not sure if there have been Html extension methods in Umbraco previously. I think it has only been methods on UmbracoHelper. https://our.umbraco.com/Documentation/Reference/Querying/UmbracoHelper/
But you can find the public methods in this class https://github.com/umbraco/Umbraco-CMS/blob/91c52cffc8b7c70dc956f6c6610460be2d1adc51/src/Umbraco.Web/HtmlStringUtilities.cs
Thanks Bjarne
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
umbraco.library in v8
Im trying to do the basic line break in multiline in a partial
Like so:
but get an error
Has something changed in 8 or am i just missing something obvious?
umbraco.library
is no longer available, I think you can use@(Html.ReplaceLineBreaksForHtml(item.Value("citatet")))
instead.As Sebastiaan says
umbraco.library
is no longer available or basically everything inumbraco
namespace (notice the lowercaseumbraco
).Also in Umbraco v7 the
umbraco.library
is obsolete, where you can useUmbraco.ReplaceLineBreaks()
.In Umbraco v8
.ReplaceLineBreaks()
method doesn't exists inUmbracoHelper
, but is anHtml
extension method.Thanks guys. Is there the documentation concerning the "Html" extension method anywhere?
I am not sure if there have been
Html
extension methods in Umbraco previously. I think it has only been methods onUmbracoHelper
. https://our.umbraco.com/Documentation/Reference/Querying/UmbracoHelper/But you can find the public methods in this class https://github.com/umbraco/Umbraco-CMS/blob/91c52cffc8b7c70dc956f6c6610460be2d1adc51/src/Umbraco.Web/HtmlStringUtilities.cs
Thanks Bjarne
is working on a reply...