I'm attempting to create a custom checkboxlist for Contour that gets some data from the content tree (children of the node where my Contour form is embedded). The checkbox list has a prevalue set to show those nodes, but it only shows the name of the node -- I need to show additional information from those nodes, in addition to the name of the node.
So, I've created a razor script (\umbraco\plugins\umbracoContour\Views\Forms\{guid}\FieldName.cshtml) for the checkboxlist field that I want to render. How do I reference the current node in the content tree from this .cshtml, since it inherits from FieldViewModel? I'm looking to do something like Model.CurrentPage.Children...
Accessing node data from Contour FieldViewModel
I'm attempting to create a custom checkboxlist for Contour that gets some data from the content tree (children of the node where my Contour form is embedded). The checkbox list has a prevalue set to show those nodes, but it only shows the name of the node -- I need to show additional information from those nodes, in addition to the name of the node.
So, I've created a razor script (\umbraco\plugins\umbracoContour\Views\Forms\{guid}\FieldName.cshtml) for the checkboxlist field that I want to render. How do I reference the current node in the content tree from this .cshtml, since it inherits from FieldViewModel? I'm looking to do something like Model.CurrentPage.Children...
Using Umbraco 4.11.9, Contour 3.0.14.
thanks
Comment author was deleted
There is an example here in the forum but if I remember correctly you can just use uQuery from inside the view
Comment author was deleted
Here is one http://our.umbraco.org/forum/umbraco-pro/contour/39531-Access-the-node-from-within-the-Contour-form-razor
Tim, thanks for the quick response.
Node.GetCurrent() works fine -- I'd forgotten to include umbraco.NodeFactory in the .cshtml for my field view.
Cheers,
Brian
is working on a reply...