I am currently playing around with the editor (awesome btw!). I can't seem find an example of how the video block is set up. All new to json and pretty new to razor :P
Any pointers or links would be greatly appreciated :)
Hi Michael, here's what I use to grab the data from the Sir Trevor editor, I belive this was mostly from their docs. You can uncomment the top part to see what the datatype returns:
Thank you for the reply. It got me some of the way :)
I now get content rendered. The only problem is with the iframes, they don't work. The a tag with blank link works fine. You can see it on my umbraco 7 install here
My code looks like this:
foreach(dynamic block in CurrentPage.trevortekst.data) { @*<h2>@block.type</h2> <textarea cols="120" rows="8">@block.data</textarea><br />*@
switch((string)block.type) { case "umbraco_image": var image = Umbraco.Media((int)block.data.id); <img src="@image.GetCropUrl("umbracoFile", "big")" alt="@image.name" /> break;
case "ordered_list": case "list": case "text": string text = block.data.text; @SirTrevor.Markdown(text) break;
case "video": if (block.data.source == "youtube"){ <iframe type="text/html" src="http://www.youtube.com/embed/@block.data.remote_id" width="640" height="390" frameborder="0"></iframe> } else if (block.data.source == "vimeo"){ <iframe src="//player.vimeo.com/video/@block.data.remote_id" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> } break;
} }
The only thing that I don't understand is why there is no preview of the image when I insert it. It displays fine on the webpage but seems empty in umbraco.
Michael, if you (still) have trouble with Sir Trevor not showing images in the backoffice and you are using the Image Cropper datatype instead of the classic upload datatype, please try version 0.7.0-beta and see if this fixes it. Thanks!
Show video block
Hi
I am currently playing around with the editor (awesome btw!). I can't seem find an example of how the video block is set up. All new to json and pretty new to razor :P
Any pointers or links would be greatly appreciated :)
/Michael
Hi Michael, here's what I use to grab the data from the Sir Trevor editor, I belive this was mostly from their docs. You can uncomment the top part to see what the datatype returns:
Hope this helps!
Amir
Hi Amir
Thank you for the reply. It got me some of the way :)
I now get content rendered. The only problem is with the iframes, they don't work. The a tag with blank link works fine. You can see it on my umbraco 7 install here
My code looks like this:
I think it's something with the src attribute on the iframes?
Here is my final code. Now working with both Vimeo & Youtube.
The only thing that I don't understand is why there is no preview of the image when I insert it. It displays fine on the webpage but seems empty in umbraco.
Thank you for the help Amir :)
Michael, if you (still) have trouble with Sir Trevor not showing images in the backoffice and you are using the Image Cropper datatype instead of the classic upload datatype, please try version 0.7.0-beta and see if this fixes it. Thanks!
Hi Marc
Yes the 0.7.0 beta fixed the issue :)
Thank you
/Michael
Great. Thanks for the feedback, Michael!
is working on a reply...