Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,
Not sure if this is a question for the Nested Content guys for OEmbed, but I have an OEmbed property on a doctype i'm using for Nested Content but the oembed property returns an empty string when using:
@sectionContent.GetPropertyValue<MvcHtmlString>("video")
Where @sectionContent is my Nested Content property.
The property type returned seems to be:
Our.Umbraco.NestedContent.Models.DetachedPublishedProperty
EDIT: Umbraco 7.3
Cheers Ismael.
Hi Ismael,
Thanks for reporting. Let me reproduce this and i will get back to you.
Dave
I tried to reproduce this but I ran in to other problems.
When I use
i get a runtime error. But when I use
@sectionContent.GetPropertyValue("video")
it works just fine for me.
Here is my entire code :
@using Umbraco.Web @inherits Umbraco.Web.Mvc.UmbracoTemplatePage @{ Layout = "Master.cshtml"; var sections = Model.Content.GetPropertyValue<IEnumerable<IPublishedContent>>("nestedVideo").ToList(); } <div> @foreach(var sectionContent in sections) { <h2>@sectionContent.GetPropertyValue("title")</h2> <div> @sectionContent.GetPropertyValue("video") </div> } </div>
Strangest thing is that when I do :
@sectionContent.GetPropertyValue<string>("title")
I get a runtime error as well.
So i think it is a Nested Content issue and it is better to report it there.
I just refactored my example yet and for me it works now.
@using Umbraco.Web @inherits Umbraco.Web.Mvc.UmbracoTemplatePage @{ Layout = "Master.cshtml"; var sections = Model.Content.GetPropertyValue<IEnumerable<IPublishedContent>>("nestedVideo").ToList(); } <div> @foreach(var sectionContent in sections) { var nestedVideo = sectionContent.GetPropertyValue<MvcHtmlString>("video"); <h2>@sectionContent.GetPropertyValue("title")</h2> <div> @nestedVideo </div> } </div>
Can you post some more details about your configuration and code to render it ?
Hi Dave,
This is essentially what I have:
Data type called "video_picker" of type OEmbed Picker
Doctype named "VideoSection" with a property of "video" of type video_picker
Data Type called ncvideosection of type Nested Content. Doc Types set to VideoSection, min/max both set to 1
Doctype named "Home" with a property called videoSection of type ncvideosection
On my Home template I have the following
var section = Model.Content.GetPropertyValue<IPublishedContent>("videoSection") <div class="video"> @section.GetPropertyValue<MvcHtmlString>("video") </div>
It looks very similar to what you have, maybe I'm missing a reference somewhere, although I never received any runtime errors as you did.
Thanks.
Ok - just tried again and now it works... sigh
Not sure exactly what happened, possibly a cache thing, I restarted my machine and also republished the site and now the video appears.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Not working with Nested Content
Hi,
Not sure if this is a question for the Nested Content guys for OEmbed, but I have an OEmbed property on a doctype i'm using for Nested Content but the oembed property returns an empty string when using:
Where @sectionContent is my Nested Content property.
The property type returned seems to be:
EDIT: Umbraco 7.3
Cheers Ismael.
Hi Ismael,
Thanks for reporting. Let me reproduce this and i will get back to you.
Dave
Hi Ismael,
I tried to reproduce this but I ran in to other problems.
When I use
i get a runtime error. But when I use
it works just fine for me.
Here is my entire code :
Strangest thing is that when I do :
I get a runtime error as well.
So i think it is a Nested Content issue and it is better to report it there.
Hi Ismael,
I just refactored my example yet and for me it works now.
Can you post some more details about your configuration and code to render it ?
Hi Dave,
This is essentially what I have:
Data type called "video_picker" of type OEmbed Picker
Doctype named "VideoSection" with a property of "video" of type video_picker
Data Type called ncvideosection of type Nested Content. Doc Types set to VideoSection, min/max both set to 1
Doctype named "Home" with a property called videoSection of type ncvideosection
On my Home template I have the following
It looks very similar to what you have, maybe I'm missing a reference somewhere, although I never received any runtime errors as you did.
Thanks.
Ok - just tried again and now it works... sigh
Not sure exactly what happened, possibly a cache thing, I restarted my machine and also republished the site and now the video appears.
Cheers Ismael.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.