Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Rune Grønkjær 1371 posts 3102 karma points
    Jan 21, 2022 @ 09:32
    Rune Grønkjær
    0

    Umbraco 9 RTE local links not being parsed

    Hi Guys,

    Anyone of you experiencing that local links are not parsed? The RTE text in the generated HTML

    I'm running v9.2 and I'm getting the RTE value like this: CurrentPage.Value

    What am I doing wrong here? This just used to always work.

    /Rune

  • Rune Grønkjær 1371 posts 3102 karma points
    Jan 21, 2022 @ 12:14
    Rune Grønkjær
    101

    I solved my own mystery. I had a custom value converter that overwrote the built in ones. Too greedy I made it.

    using Microsoft.AspNetCore.Html;
    using System;
    using Umbraco.Cms.Core;
    using Umbraco.Cms.Core.Models.PublishedContent;
    using Umbraco.Cms.Core.PropertyEditors;
    using Umbraco.Extensions;
    
    namespace Website.Core.UmbracoValueConverters {
      public class HtmlStringValueConverter : PropertyValueConverterBase {
        public override bool IsConverter( IPublishedPropertyType     propertyType ) {
          return propertyType.EditorAlias.InvariantEquals(     Constants.PropertyEditors.Aliases.MultipleTextstring )
             || propertyType.EditorAlias.InvariantEquals( Constants.PropertyEditors.Aliases.TextArea )
             || propertyType.EditorAlias.InvariantEquals( Constants.PropertyEditors.Aliases.TextBox )
             || propertyType.EditorAlias.InvariantEquals( Constants.PropertyEditors.Aliases.TinyMce );
        }
    
        public override Type GetPropertyValueType( IPublishedPropertyType propertyType ) {
          return typeof( HtmlString );
        }
    
        public override object ConvertIntermediateToObject( IPublishedElement owner, IPublishedPropertyType propertyType, PropertyCacheLevel cacheLevel, object source, bool preview ) {
          return new HtmlString( (string)source );
        }
      }
    }
    
Please Sign in or register to post replies

Write your reply to:

Draft