0
votes

I am creating a news Module with a News List like this: enter image description here

I want to get the Content inside each individual News. Here is an example of the first News in the list:

enter image description here

This is what I'm trying to do in my PartialView:

enter image description here

Unfortunately, I am not able to access the News details. On the front end, my PartialView is only displaying the Name. When i try to access the summary it throws an error.

enter image description here

The content not displaying. Only the Title is displaying.

So currently, my code is able to display only the List Level of News not the Detailed Level of content. Can any one help me on this?

1

1 Answers

3
votes

Umbraco.Field() defaults to use the current pages document (so the News page). However, you're trying to use it with a specific node/page (in this case a child page).

You should be able to change your code to:

@Umbraco.Field(item, "summary")

Or personally, I prefer this syntax:

@(item.GetPropertyValue<IHtmlString>("summary"))

You can read all about getting data from a node here.