Alter RichText output in Content Delivery API
# help-with-umbraco
s
I am working on a headless solution testing out the new Content Delivery API (on Umbraco 13 right now). I am not happy with how the media data from the Rich Text Editor (Umbraco.TinyMCE) is being resolved when requesting it in the API - specifically I am looking to change the image markup a little bit. To do this, I have tried creating a custom value converter implementing
IPropertyValueConverter
that I have set up to handle a specific RTE datatype I have created. I can tell, however, that I am overriding functionality "too early". When implementing the
ConvertSourceToIntermediate()
method, I can see that the source does not contain what I am seeing in the API output (The markup contains a Udi reference rather than a url of the media item). I would like the built-in conversion from source data to the API output to still apply, and then make my custom changes afterwards. In other words, I would like to alter the markup outputted from the RichTextEditor when it contains this
src="http://my-test-site/media/12cbr4lj/myimage-01.jpg"
rather than this:
data-udi="umb://media/f91804d9c36943aea28df76a7f89d800"
Is there a way I can hook into the Content Delivery API response after the default conversion, but before it is returned in the request? Or will I have to re-implement the built-in conversion from scratch and apply my changes?
20 Views