@foreach(var item in CurrentPage.Children().Where("Visible")){
var optionList = item.kompetencer.ToString().Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
var optionCollection = Umbraco.Content(optionList);
var list = new List<string>();
foreach (var node in optionCollection){
list.Add(node.Id.ToString());
}
<div class="item" data-ids="@list"><a href="#">@item.Name</a></div>
}
MNTP - Split id's
Hi I would like to split the Id's from selected nodes in the MNTP like so:
Right now my code looks like this
And it gives me the following output
Hope some one can give me some directions :)
Hi Mads,
The
@list
will need to be joined together using a space, like so...I hope this helps?
Cheers,
- Lee
Hi Lee Thanks that made my day :)
Is there a reference how to handle json data :D
Cheers ,-
Mads
JSON data, how do you mean? As in JSON coming from an Umbraco node property? or that you want to construct a JSON object in your Razor view?
I was quite sure that the MNTP output was JSON data :) But maybe i was wrong :)
is working on a reply...