Hello umbraco users maybe this is a simple question but now I have used to long on this. on my document type I got a contentpicker which takes a content id, in my partial view I have to get the node and then use the nodes content to show on the site.
I tried a lot of diffendes stuff but what I was thinking would work was this. but this give me a partial view error
var node = Umbraco.Content(CurrentPage.contentPickerValue);
@node.bodyText
and yes I get the id with CurrentPage.contentPickerValue
hi Dennis after you also said Umbraco.Content like I already did i deleted the partial view and tried from scratch and now it works, really don't know what went wrong ?
Now im trying to make this
if(node.NodeTypeAlias == "documentType")</p>
{
do somthing
}
get node by id in partial view
Hello umbraco users maybe this is a simple question but now I have used to long on this.
on my document type I got a contentpicker which takes a content id, in my partial view I have to get the node and then use the nodes content to show on the site.
I tried a lot of diffendes stuff but what I was thinking would work was this. but this give me a partial view error
var node = Umbraco.Content(CurrentPage.contentPickerValue);
and yes I get the id with CurrentPage.contentPickerValue
Hi Dan,
I think somethink like this should work:
and if it dosen´t work with the CurrentPage you could try:
You can find the documentation for the content picker here: http://our.umbraco.org/documentation/Using-Umbraco/Backoffice-Overview/Property-Editors/Built-in-Property-Editors/Content-Picker
Hope this helps,
/Dennis
hi Dennis
after you also said Umbraco.Content like I already did i deleted the partial view and tried from scratch
and now it works, really don't know what went wrong ?
Now im trying to make this
But the NodeTypeAlias is empty ?
thanks for the help dennis I appreciate it
I found this http://our.umbraco.org/forum/developers/razor/38239-Umbraco-6-CurrentPageNodeTypeAlias-empty and tried DocumentTypeAlias and that worked for the alias but thanks for the help anyway Dennis :D
Hi Dan,
Try this one instead:
Hope this work for you.
Edit: Okay Dan you found the same as me :)
/Dennis
is working on a reply...