Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi, I'm having trouble with pulling the individual values from the data grid. I can get the full string with both label and value, but i'm new to razor and having trouble.
@widget.featureBlock gives me everything within the datatype.
[ { "blockTitle": "Feature Block 1", "blockParagraph": "Feature Block 1 Content", "blockIcon": "1094", "urlPicker": "1062" }, { "blockTitle": "Feature Block 2", "blockParagraph": "feature Block 2 Content", "blockIcon": "1095", "urlPicker": "1054" } ]
My razor macro is
@{ var widgetsFolder = Model.WidgetsFolders.Where("Visible").First(); } @foreach (dynamic widget in widgetsFolder.Children.Where("Visible and nodeTypeAlias.StartsWith(\"Widget_\")")) { string widgetType = widget.NodeTypeAlias.ToString(); switch (widgetType) { case "Widget_FeatureBlocksReveal": @showFeatureBlocksReveal(widget); break; default: <b>Unknown Widget!</b> break; } } @helper showFeatureBlocksReveal(dynamic widget){ if (!string.IsNullOrEmpty(widget.featureBlock.ToString())) { foreach(dynamic content in widget.featureBlock) { @content.blockTitle } } }
Any help would be grateful.
Martin
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Trouble With Razor Values in U7 Data Grid
Hi, I'm having trouble with pulling the individual values from the data grid. I can get the full string with both label and value, but i'm new to razor and having trouble.
@widget.featureBlock gives me everything within the datatype.
[ { "blockTitle": "Feature Block 1", "blockParagraph": "Feature Block 1 Content", "blockIcon": "1094", "urlPicker": "1062" }, { "blockTitle": "Feature Block 2", "blockParagraph": "feature Block 2 Content", "blockIcon": "1095", "urlPicker": "1054" } ]
My razor macro is
Any help would be grateful.
Martin
is working on a reply...