pulling in content - high level guidance requested
Looking for some high level guidance on getting my content working.
I have a basic template set up, and am looking to pull one (or more) content objects, loop on them, and output the data.
I have my master content object (MemberHome), and a child content object associated to it:
The associated content has a few different fields that need to be output in specific places.
My goal is to check for a specified number of these child content objects, loop through them, then build and output the required html and content. I'm looking for advice on how to get started, and what features/functions I should be using to facilitate this.
pulling in content - high level guidance requested
Looking for some high level guidance on getting my content working.
I have a basic template set up, and am looking to pull one (or more) content objects, loop on them, and output the data.
I have my master content object (MemberHome), and a child content object associated to it:
The associated content has a few different fields that need to be output in specific places.
My goal is to check for a specified number of these child content objects, loop through them, then build and output the required html and content. I'm looking for advice on how to get started, and what features/functions I should be using to facilitate this.
Thanks in advance
I have made some progress. I'd like to update where I'm at and if anyone has suggestions or corrections I'm all ears.
I created a "Partial View Macro" and referenced it inside a "Macro" using the MVC Partial View input area.
Inside the primary template, I am referencing the Macro via:
@Umbraco.RenderMacro("BabyMacro")
Inside the partial view macro, I'm using a query to pull child content objects by name:
var selection = CurrentPage.Site().Children("memberHomeMainNewsArticle").Where("Visible");
I'm running a loop and using GetPropertyValue to output the content data as needed:
@foreach(var item in selection){
Any hints, suggestions, corrections greatly appreciated
is working on a reply...