In case I've added a property of Data Type List View - Content onto a Document Type. Then I created several content items using the ListView Content control (Create etc.).
Is there a way to retrieve those created records and render them on the front end inside a Template?
There's lots of ways, if you go to Settings > Partial Views > Create you'll see lots of snippets you can start with depending on whether you want to list them by document type, children of a start node, etc.
Quick example below to list them with a start node and limit the query by document type.
Hope this helps!
Amir
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
var startNode = Umbraco.Content(1234);
var selection = startNode.Descendants("YourDocTypeHere").Where("Visible");
}
Render ListView Content on front-end
Hi,
In case I've added a property of Data Type List View - Content onto a Document Type. Then I created several content items using the ListView Content control (Create etc.).
Is there a way to retrieve those created records and render them on the front end inside a Template?
Thanks
Hi Bilal,
There's lots of ways, if you go to Settings > Partial Views > Create you'll see lots of snippets you can start with depending on whether you want to list them by document type, children of a start node, etc.
Quick example below to list them with a start node and limit the query by document type.
Hope this helps!
Amir
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
var startNode = Umbraco.Content(1234); var selection = startNode.Descendants("YourDocTypeHere").Where("Visible"); }
@if (selection.Any()) {
foreach (var node in selection) {
@node.Name
}}
Thanks Amir. Maybe I didn't explain myself clear. I wanted to render the List View Content Grid as is on the front end.
Thanks
is working on a reply...