Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • bparks 23 posts 79 karma points
    Sep 23, 2013 @ 09:10
    bparks
    0

    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

    Sep 23, 2013 @ 09:50

    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

    Sep 23, 2013 @ 09:52
  • bparks 23 posts 79 karma points
    Sep 23, 2013 @ 10:03
    bparks
    0

    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

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies