I'm fairly new to the whole razor syntax and putting the pieces together for working with the syntax and an Ultimate Picker data type property.
What I've got is a Document Type 'eventpage' which has a property on it which is based on a data type that is of the type Ultimate Picker. This DataType is set to a checkbox list which all works fine and lets me select the appropriate nodes.
The problem I'm having is in displaying the selected nodes. I've created a razor script which should list the nodes that are selected for the current eventpage. The only thing i can get is a string list of the selected nodes, but i can't seem to get them with a separator character. So what i'm getting is: 11441042
What i am looking for is something i can split up so that i can, for instance, get the nodes names to be displayed on the eventpage. Here is the razor code i've tried so far (some lines commented out):
Ultimate Picker property value
Hello,
I'm fairly new to the whole razor syntax and putting the pieces together for working with the syntax and an Ultimate Picker data type property.
What I've got is a Document Type 'eventpage' which has a property on it which is based on a data type that is of the type Ultimate Picker. This DataType is set to a checkbox list which all works fine and lets me select the appropriate nodes.
The problem I'm having is in displaying the selected nodes. I've created a razor script which should list the nodes that are selected for the current eventpage. The only thing i can get is a string list of the selected nodes, but i can't seem to get them with a separator character. So what i'm getting is: 11441042
What i am looking for is something i can split up so that i can, for instance, get the nodes names to be displayed on the eventpage. Here is the razor code i've tried so far (some lines commented out):
foreach (var eventpage in events.Children)
{
string cat = "none found";
if (eventpage.HasProperty("Categories"))
{
string[] nodes = eventpage.GetPropertyValue("Categories").Split(',');
foreach (string node in nodes)
{
cat += node.NodeName + "<br />";
}
//cat = eventpage.GetPropertyValue("Categories");
//cat = eventpage.Categories.ToString();
}
}
I think you will find the examples you need in my example site here: http://our.umbraco.org/projects/developer-tools/cultiv-razor-examples
is working on a reply...