need to get first node from Multi-Node Tree Picker
I am trying to do this new site in MVC instead of webforms and xslt so I can learn MVC and razor, but things that are so simple to do in xslt seem so difficult with razor. Please help me out, I am sure this is a simple question.
I am using Umbraco v6.1.6
I have a Multi-Node Tree Picker on my page (alias= 'pageContent'), and I want to get the first item.
'Umbraco.Web.Models.RenderModel' does not contain a definition for 'XPath
Am I just missing something to use the dynamic node stuff? I can't find anywhere that says what I need to include to use that. (Also tried using @CurrentPage instead of @Model but @CurrentPage doesn't exist)
Next step would be to get the actual node represented by that Id so I can use it to display property values of. So if you have a full solution that would be great... :)
need to get first node from Multi-Node Tree Picker
I am trying to do this new site in MVC instead of webforms and xslt so I can learn MVC and razor, but things that are so simple to do in xslt seem so difficult with razor. Please help me out, I am sure this is a simple question.
I am using Umbraco v6.1.6
I have a Multi-Node Tree Picker on my page (alias= 'pageContent'), and I want to get the first item.
In xslt that would be something simple like:
<xsl:variable name="myNode" select="$currentPage/pageContent/MultiNodePicker/nodeId[1]"/>
I am looking at this page as reference, but not sure how to get it to work: http://our.umbraco.org/wiki/reference/code-snippets/razor-snippets/get-values-from-ucomponents-multi-node-tree-picker-multiple-textstring
I tried the first example there and the xpath example, but they both throw an error.
Here is my master template, just right now simply trying to print out the node id to start.
but the error I get is:
'Umbraco.Web.Models.RenderModel' does not contain a definition for 'XPath
Am I just missing something to use the dynamic node stuff? I can't find anywhere that says what I need to include to use that. (Also tried using @CurrentPage instead of @Model but @CurrentPage doesn't exist)
Next step would be to get the actual node represented by that Id so I can use it to display property values of. So if you have a full solution that would be great... :)
ok, 3 hours later finally got something to work:
now to try to get the node and use that... ( I am not sure why anyone things MVC is easier.... ?? uQuery.GetXmlIds makes no intuitive sense! )
Also I guess I was trying @CurrentPage in stead of just CurrentPage before ...
And lastly, got the node part etc:
and then to use it later in the page:
is working on a reply...