Hi Stephen, have you tried the latest version? I've added it to a form and am rendering the content with:
@inject HtmlLocalLinkParser HtmlLocalLinkParser;
@inject HtmlUrlParser HtmlUrlParser;
@inject HtmlImageSourceParser HtmlImageSourceParser;
@{
if (Model.AdditionalSettings.TryGetValue("Html", out var value))
{
value = HtmlLocalLinkParser.EnsureInternalLinks(value);
value = HtmlUrlParser.EnsureUrls(value);
value = HtmlImageSourceParser.EnsureImageSources(value);
<div id="@Model.Id">
@Html.Raw(value)
</div>
}
}
both of them are rendering the link with a url to the root of the site. Checking the value, i can see that the url being passed into Html.Raw is already href="/". It looks like the url or locallink is being stripped out of the version of the RTE being used in forms?
The solution this question was regarding is currently using Umbraco.Cms 10.2.0 and Umbraco.Forms 10.1.2. Using the default rich text field template, it works as expected when creating hyperlinks:
Umbraco Forms 9+ Rich Text
I'd like to display some rich text between questions in an Umbraco Form.
An example use case would be to render a hyperlink to supporting documentation, or to a privacy policy above the submit button.
There are forum threads and even a package to achieve this for Umbraco versions 7 and 8, but I've not found anything for Umbraco 9 and up.
Following the documentation on creating an Umbraco Forms custom field type I have created a custom field type with a working setting field to populate and render, but I'm stuck on how to enhance this with the Umbraco 9 rich text editor.
Any pointers or examples on how to do this?
I've just spoken to Matthew (the author) I will work on a PR for V9 and V10 for the Umbraco Forms Rich Text Editor package =]
That's awesome, thank you!
For future thread visitors:
Umbraco Forms Rich Text package (now with version 3.0.0-alpha for Umbraco 10):
https://our.umbraco.com/packages/backoffice-extensions/umbraco-forms-rich-text/
The package source code:
https://github.com/Matthew-Wise/umbraco-forms-rte
An update for any future readers: As of Umbraco Forms versions 9.5 and 10.1, there is now a rich text field included out of the box!
https://umbraco.com/blog/umbraco-forms-81395101-release/
Hi Stephen, have you tried the latest version? I've added it to a form and am rendering the content with:
both of them are rendering the link with a url to the root of the site. Checking the value, i can see that the url being passed into Html.Raw is already href="/". It looks like the url or locallink is being stripped out of the version of the RTE being used in forms?
Hi Ian, I've not used the latest version yet.
The solution this question was regarding is currently using Umbraco.Cms 10.2.0 and Umbraco.Forms 10.1.2. Using the default rich text field template, it works as expected when creating hyperlinks:
Might be worth creating a new question for better visibility of your issue?
is working on a reply...