I have a question about Macro/ partial View Macro and Contentpicker
My problem is that when i go in to gridlayout => choose a Macro to put in => choose an item "like the second item", then the first item in the list appears. And its because its "FirstOrDefault()" i only want to show one of them.
@{
var selection = Model.Content.Site().FirstChild("blog").Children("blogpost").FirstOrDefault();
var pickedContent = Model.MacroParameters["productPicker"];
}
<div> <p>@selection.Name</p></div>
So what should i do if i want to display the second one, or the third one?
Macro, Content picker sshow selected item.
Hello,
I have a question about Macro/ partial View Macro and Contentpicker
My problem is that when i go in to gridlayout => choose a Macro to put in => choose an item "like the second item", then the first item in the list appears. And its because its "FirstOrDefault()" i only want to show one of them.
So what should i do if i want to display the second one, or the third one?
Thanks Kind regards/ Emil
Hi Emil
So when you read the 'picked' blog article id from the macro parameter
You can then use this id to retrieve the full blog post content from Umbraco, using the Umbraco TypedContent helper eg
regards
Marc
Hello Marc, Srry for the late reply. But that was exactly what I searched for. Thank you. Kind regards Eemik
is working on a reply...