Last active
December 16, 2015 15:39
-
-
Save sniffdk/5457886 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Typed | |
var ids = Model.Content.GetPropertyValue<string>("mNTP", true, "").Split(new[] {","}, StringSplitOptions.RemoveEmptyEntries); | |
var items = Umbraco.TypedContent(ids); | |
// Dynamic | |
@if (CurrentPage.HasValue("mNTP", true)) | |
{ | |
var ids = CurrentPage._mNTP.Split(','); | |
var items = Umbraco.Content(ids); | |
foreach (var item in items) | |
{ | |
<p>@item.Name</p> | |
} | |
} |
I didn't say, I wouldn't use your solution. I'm just saying your snippet looks more complicated than the one provided by Umbraco itself and I want to understand what the problem is before I switch. And when I say it doesn't work I just mean the values for the properties are not used (banner doesn't show anywhere) when I use underscore.
Anyway, thank you for your help. I have now enough material to go on. I'll post back when I have a working solution.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As I wrote on Twitter, that example uses the old MacroEngines api, it seems it haven't been updated to the new IPublishedContent api. And yes, prefixing a property name, when using dynamic, will make the property recursive. Is there a reason why you won't make due with the code I provided? I'm not sure why you insist on using the old api? And I'm not sure what "does not work" means, could use a little more detail :)