diff --git a/src/Umbraco.SampleSite.Web/Views/MacroPartials/FeaturedProducts.cshtml b/src/Umbraco.SampleSite.Web/Views/MacroPartials/FeaturedProducts.cshtml index 4dd2478e..b935e1bd 100644 --- a/src/Umbraco.SampleSite.Web/Views/MacroPartials/FeaturedProducts.cshtml +++ b/src/Umbraco.SampleSite.Web/Views/MacroPartials/FeaturedProducts.cshtml @@ -6,22 +6,45 @@ @inject UmbracoHelper Umbraco @inject IPublishedValueFallback PublishedValueFallback @inject IPublishedUrlProvider PublishedUrlProvider + @* This snippet lists the items from a Multinode tree picker, using the pickers default settings. Content Values stored as xml. To get it working with any site's data structure, set the selection equal to the property which has the multinode treepicker (so: replace "PropertyWithPicker" with the alias of your property). + + But for classic version of a macro you use the parameter settings *@ -@{ var selection = Model.Content.Value>(PublishedValueFallback, "PropertyWithPicker").ToArray(); } +@{ + //example 1: using document type properties for this macro + var contentMntpSelection = Model.Content.Value>(PublishedValueFallback, "PropertyWithPicker")?.ToArray(); + + //example 2: using classic macro parameter + var selection = Model.MacroParameters.FirstOrDefault(p => p.Key == "product").Value?.ToString().Split(','); - +} \ No newline at end of file