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
In a template for my slideshow document type I want to render all the items added to a Nested content property:
In my template I have this code:
@using ContentModels = Umbraco.Web.PublishedModels;
Layout = null;
var items = Model.Value<IEnumerable<IPublishedElement>>("slides");
foreach(var item in items)
var slide = item.Value<IPublishedElement>("slide");
var foo = item.Value<string>("foo");
<p>slide: @slide.Id, foo: @foo</p>
The code above is for proof of concept, but it gives an error in line 14:
Server Error in '/' Application.
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS1503: Argument 1: cannot convert from 'method group' to 'HelperResult'
Line 12: var foo = item.Value<string>("foo");
Line 14: <p>slide: @slide.Id, foo: @foo</p>
Line 15: }
Line 16: }
I want to get the id of the linked node so I can call Umbraco.Content to get the content of that linked node.
What am I doing wrong?
Just encapsulate it in brackets and it works.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted