I have been given the task to Umbraco-fy a page which is basically static in nature and has a javascript quotes process which uses hard coded values in a json array:
I have created the umbraco doc types and populated with data.
I have a razor script that outputs the data in JSON format but I can't get it right.
@{
var items = new List<dynamic>();
foreach (var products in node) {
var rangename = @products.GetPropertyValue("color"); var fcpm1 = @products.GetPropertyValue("3sqm"); var fcpm2 = @products.GetPropertyValue("5sqm"); var fcpm3 = @products.GetPropertyValue("8sqm");
I don't believe it's clear what you're trying to do.
Am right in thinking that you have a list of products which have a colour and size attribute the editors can set - depending on the selected product you need to get the correct numeric value which you need to look up from the static list (which you're keeping in different nodes?).
Output Nodes in Json format
Hello,
I have been given the task to Umbraco-fy a page which is basically static in nature and has a javascript quotes process which uses hard coded values in a json array:
I have created the umbraco doc types and populated with data.
I have a razor script that outputs the data in JSON format but I can't get it right.
I get this output whcih is wrong:
The first problem is that each color needs to be represented with a value within the group. At the moment it has two value pairs.
Any help to get it in the right format would be really helpful.
Thanks
Any ideas
I don't believe it's clear what you're trying to do.
Am right in thinking that you have a list of products which have a colour and size attribute the editors can set - depending on the selected product you need to get the correct numeric value which you need to look up from the static list (which you're keeping in different nodes?).
What would a correct output look like?
is working on a reply...