4-Roads / FourRoads.TelligentCommunity

A collection of plugins to extend the functionality of the Telligent Community platform
MIT License
6 stars 9 forks source link

[WIP] Inline Content - Allow embeddable content #24

Closed rhysgodfrey closed 8 years ago

rhysgodfrey commented 8 years ago

This PR is still a work in progress/request for comments.

Allow Inline Content to support embeddable content fragments such as Polls.

The method that persists the polls needs a valid ContentId and ContentTypeId to store against. From the checks I've run looks like ApplicationTypeId and ContainerTypeId are also valid ContentTypeIds.

Currently when editing the InlineContent the poll doesn't render (so unable to edit a poll once created, or edit the content without losing the poll), not sure why this is.

rhysgodfrey commented 8 years ago

Don't think it's to do with the Ids, I've tried manually setting those, and not had any luck.

It looks like the tokens put into the content for use by FileViewers etc. are being stripped out by the editor when you use the Inline Content edit mode.

For example if my content is:

<p>Test</p>
<p>[embed:33ecb077-39b7-4078-9b1e-dc3f977a690b:c5fba203-daf1-476e-8701-9547d2584f9a:question=asdgasdgd&description=&pollOptions=%5B%7B%22OptionId%22%3A%22a31523a8-8cb0-4220-94a0-1127c05c936e%22%2C%22Option%22%3A%22asdgsd%22%2C%22Ordinal%22%3A0%7D%2C%7B%22OptionId%22%3A%22c8f72604-51e3-40a1-bc41-3533b911d6d2%22%2C%22Option%22%3A%22eawtawet%22%2C%22Ordinal%22%3A1%7D%5D&expiredate=0001-01-01%2000%3A00%3A00&ShowResultsConfiguration=1%2C1]</p>

The [embed...] tag is removed and replaced with a &nbsp;, the same behaviour occurs with videos, e.g.:

<p>[View:https://www.youtube.com/watch?v=CBfmTO3gcNU:320:192]</p>

Images appear to be OK as they are switched to standard HTML:

<p><a href="/cfs-file/__key/fourroads-inlinecontent/28426057_2D00_b805_2D00_4459_2D00_9868_2D00_67d82e754814-2100-complete/6tag_5F00_070316_2D00_185402.jpg"><img style="max-width: 320px; max-height: 240px;" src="/resized-image/__size/640x480/__key/fourroads-inlinecontent/28426057_2D00_b805_2D00_4459_2D00_9868_2D00_67d82e754814-2100-complete/6tag_5F00_070316_2D00_185402.jpg" alt="" /></a></p>