I had the following working until i upgraded to 7.52. this is a composition named product that has a link for external site. after the upgrade it is like Umbraco can not see Nested Content.
@{
var items = Model.GetPropertyValue<IEnumerable<IPublishedContent>>("product");
<div class="row">
@foreach (var item in items)
{
var widgetLink = item.GetPropertyValue<UrlPicker>("productLink");
var imageId = item.GetPropertyValue<int>("productImage");
var image = Umbraco.TypedMedia(item.GetPropertyValue("productImage"));
if (widgetLink != null && widgetLink.Meta != null && widgetLink.Type != null)
{
var linkTarget = widgetLink.Meta.NewWindow ? "_blank" : null;
var linkUrl = widgetLink.Url;
string linkText = null;
if (widgetLink.Meta.Title != null)
{
linkText = widgetLink.Meta.Title;
}
if (widgetLink.Type == UrlPicker.UrlPickerTypes.Url)
{
if (!string.IsNullOrEmpty(linkUrl) && !(linkUrl.StartsWith("http://") && !(linkUrl.StartsWith("https://"))))
{
linkUrl = "http://" + linkUrl;
}
}
if (!string.IsNullOrEmpty(linkUrl))
{
<div class="col-lg-3">
<a href="@linkUrl" target="@linkTarget" title="@linkText">
@if (item.HasValue("productImage"))
{
<img class="img-responsive" src="@image.Url" width="270" height="100" alt="@item.Name"/>
}
</a>
</div>
}
}
}
</div>
}
It's pretty impossible for me to know what the cause it without any error messages, etc.
Have you tried a process of elimination? Removing code (commenting out) and seeing what does work until you hit the line of code that is causing the problem?
nested Content stops working after 7.52 Upgrade
I had the following working until i upgraded to 7.52. this is a composition named product that has a link for external site. after the upgrade it is like Umbraco can not see Nested Content.
Hi Keith,
After you call...
Does
@items
contain any value?I haven't heard of any problems with NestedContent on v7.5.x yet.
Cheers,
- Lee
hello Lee
the items is just a collection of the items in the composition. see attached image
OK, does it contain any values when you run the Razor code?
it kills all my razor code. it only sees the sections and div's
Hi Keith,
It's pretty impossible for me to know what the cause it without any error messages, etc.
Have you tried a process of elimination? Removing code (commenting out) and seeing what does work until you hit the line of code that is causing the problem?
Thanks,
- Lee
Lee Luckily I had Jeavon look at it. For some reason Urlpicker will not update to v.0.16 with NuGet or package install. Any ideas would help.
is working on a reply...