UI 2012 RTF Extension and Custom Rendering

120 views Asked by At

We have an extension that is based on an extended hyperlink containing data pertaining to the type of content that will be rendered - so as an example...

<a href="tcm:1-123" title="video-example"><img class="videoCSS"/></a>

The class allows us to have a style showing the appropriate icon to the user (as noted in the FormatAreaStyles.css for the CME RTF and in the website CSS for the UI).

As such we have an extension that detects and deals with the <a> element. However, when this is viewed through the UI it's viewed (and interacted with) as an <object> tag as it's been rendered at this point. - this isn't correct! When published, the custom rendering takes place - when edited, the component is retrieved with the element still in tact - the confusion had arisen as we saw the rendered in the preview page and when edited this vanished and we didn't see our original icon - it turns out the original icon was simply broke as the (style) image wasn't available from the published website!

My initial though was to try and keep this "simple" - the editor see's a video icon (as they do in the CME) rather than the rendered video in UI - if they want to see full page context they have to view in staging (allowing existing extended interaction with the RTF). However, how do we know if the content is being rendered for the UI or not... or would it have to be done at the publication target level on the siteedit enabled tag.

If the latter then this would mean changing all rendering code to a custom renderer or have something react based on the publication target.

EDIT Useful post from Will Price @ Problems detecting when we are doing CMS Preview vs Dynamic Preview in 2012 UI/XM

I'm guessing the alternative would be that we'd have to extend the UI RTF Extension JS to backwards engineer, update, remove and replace the actual rendered HTML which sounds like an absolute nightmare to do/manage if it's even feasible!!!

Have you come across this yet/any thoughts?

As usual - thanks for comments!

UPDATE Unfortunately this question went off track due to a different error throwing the thought process out of synch! I've left this here in case anyone has a similar issue and is veering off-track also!

0

There are 0 answers