Copied to clipboard

Flag this post as spam?

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

  • Nirmit 24 posts 97 karma points
    Mar 31, 2015 @ 07:24

    Extending RTE property value converter


    I have a specific requirement to extend existing RteMacroRenderingValueConverter (or create a new convertor for RTE Datatype). I have created a tinymce-plugin similar to Umbraco Link plugin which allows user to add a Product link. (i.e, user can insert a product-link for product code=123 as <a href="{\ProductLink:ProductCode=123}">Product Page</a> ) Now I want to get it converted to actual link (i.e,{current-culture}/Product/Details/123) while rendering the page.

    The challenge I have is Umbraco does not allow more than one convertor per property.

    So wondering if there is any way to achieve this functionality.

    Many thanks in advance.


  • Dave Woestenborghs 3431 posts 11702 karma points MVP 7x admin c-trib
    Mar 31, 2015 @ 08:24
    Dave Woestenborghs

    Hi Nirmit,

    I think you need to create your own value convertor for this.

    To remove the default value convertor for the Rte you can use this code :

     public class UmbracoEvents : ApplicationEventHandler
           protected override void ApplicationStarting(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)

    Now you can create your own implementation of the TinyMceValueConvertor.

    A good starting point is the source of the default one :


  • Nirmit 24 posts 97 karma points
    Apr 01, 2015 @ 03:32

    Thanks dave for the suggestion. It solved my problem. :)

  • Comment author was deleted

    May 13, 2015 @ 22:04

    +1, Had to use this today :)

  • Jesse Andrews 183 posts 704 karma points c-trib
    Oct 31, 2018 @ 18:23
    Jesse Andrews

    This approach generally works, but I encountered issues when there were macros in the rich text editors. To get around that, I replaced RteMacroRenderingValueConverter instead of TinyMceValueConverter. There are a couple caveats to be aware of.

    1. RteMacroRenderingValueConverter is in the Umbraco.Web namespace and not Umbraco.Core like the others.
    2. The modified version of the RteMacroRenderingValueConverter will need to return an IHtmlString instead of a string. I'm pretty sure the DefaultPropertyValueConverter attribute causes the TinyMceValueConverter to run against the data after the RteMacroRenderingValueConverter does its thing. Unfortunately, it's an internal attribute and so can't be incorporated into custom code.
Please Sign in or register to post replies

Write your reply to: