Last updated
Last updated
This section will describe how you can render content from other nodes besides the current page in your MVC Views
The easiest way to get some content by Id is to use the following syntax (where 1234 is the content id you'd like to query for):
You can also query for multiple content items using multiple ids:
This syntax will support an unlimited number of Ids passed to the method.
You can also retrieve content using the Guid
Id. In the example "ca4249ed-2b23-4337-b522-63cabe5587d1" is the key of the content.
You can also pass a to retrieve the content.
The same query structures apply to media:
All of these extension methods are available on Umbraco.Core.Models.IPublishedContent
so you can have strongly typed access to all of them with intellisense for both content and media. The following methods return IEnumerable<IPublishedContent>
Additionally there are other methods that will return a single IPublishedContent
With the IPublishedContent
model we support strongly typed LINQ queries out of the box so you will have intellisense for that.
With the strongly typed IPublishedContent
you can do complex queries.