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
Morning
I have created a rich text editor macro which only allows centering text and adding a link.
Currently everything is working as intended except for adding a link to the text.
If you manually type the in the url box the link works correctly.
if you decide to pick from the list of a location on the site the href of the link is set too "%7BlocalLink:1055%7D" which causes to display an error.
Controller:
angular.module("umbraco") .controller("widetexteditor.controller", function ($scope) { $scope.textInput = { label: 'Body Text', description: 'Rich text editor', view: 'rte', value: $scope.model.value, config: { editor: { toolbar: ["alignleft", "aligncenter", "link"], dimensions: { height: 400} } } }; $scope.$watch('textInput.value', function (newValue, oldValue) { $scope.model.value = newValue; }); });
View:
<div ng-controller="widetexteditor.controller"> <ng-form> <umb-editor model="textInput"></umb-editor> </ng-form> </div>
Manifest:
{ alias: "PageWideTextAreaDataType", name: "Page Wide Text Box", isParameterEditor: true, editor: { view: "~/App_Plugins/widetexteditor.html", valueType: "text" }
I have found some old information on bugs that should be fixed about local links not being parsed. This kind of feels similar hopefully someone will be able too help.
Hi Chris,
I've stumbled across this many times. Along with other things not rendering properly in Macro RTE's
You can use the following code to fix your local links URL (note, I've made a function to save repeating the if statement)
if
public string RenderRTEContent(string content) { if (UmbracoContext.Current != null) { content = TemplateUtilities.ParseInternalLinks(content, UmbracoContext.Current.UrlProvider); } return content }
Then in your view, call it like so
@Html.Raw(RenderRTEContent(rteContent))
Thank you Daniel using Parse Internal Links something i was not aware of has fixed my issue.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Macro Rich Text Editor Not Parsing Local Links
Morning
I have created a rich text editor macro which only allows centering text and adding a link.
Currently everything is working as intended except for adding a link to the text.
If you manually type the in the url box the link works correctly.
if you decide to pick from the list of a location on the site the href of the link is set too "%7BlocalLink:1055%7D" which causes to display an error.
Controller:
View:
Manifest:
I have found some old information on bugs that should be fixed about local links not being parsed. This kind of feels similar hopefully someone will be able too help.
Hi Chris,
I've stumbled across this many times. Along with other things not rendering properly in Macro RTE's
You can use the following code to fix your local links URL (note, I've made a function to save repeating the
if
statement)Then in your view, call it like so
@Html.Raw(RenderRTEContent(rteContent))
Thank you Daniel using Parse Internal Links something i was not aware of has fixed my issue.
is working on a reply...