I've inherited an umbraco project (meaning, not much experience with it), I'm working on migrating from v7 to v8.11 and I'm stuck with the changes regarding the nodes.
var slidesNode = Node.GetCurrent().GetChildNodeByName(model.HomepageSlidesNodeName);
var content = Umbraco.TypedContent(Node.getCurrentNodeId());
Can anyone please point me to some documentation about getting the current node and how to work with nodess in version 8?
The why is quite simple, I'm the only one in the team that has even touched Umbraco and upgraded DNN to the latest version and boom, I'm the upgrade guy :)
var slidesNode = Umbraco.AssignedContentItem.Children.FirstOrDefault(x => x.Name.Equals(model.HomepageSlidesNodeName));
And this is a second line:
var content = Umbraco.AssignedContentItem;
In the first line, I would not recommend you using node name for retrieving the content, if somebody changes the name in the backend this logic will not work. Use Id or doctypeAlias for this logic or content picker on a root node.
Umbraco V7 -> V8 changes - looking for equivalent methods / documentation
Hello everyone.
I've inherited an umbraco project (meaning, not much experience with it), I'm working on migrating from v7 to v8.11 and I'm stuck with the changes regarding the nodes.
Can anyone please point me to some documentation about getting the current node and how to work with nodess in version 8?
The only thing I've found is a few words in Umbraco helper - Working with Content.
Thank you,
Moving from v7 to v8 - can be a difficult challenge. Especially, if the site uses a lot of custom datatypes, which dont have a v8 equivilant.
Ask yourself "WHY" you need to be on v8. Is there some technology you need to harness? or is it merely a "hobby challenge"?
If you are "New to Umbraco" - I would suggest learning more about how v7 works, and the ModelsBuilder, and how to Query the Tree node structure.
Good Luck!
The why is quite simple, I'm the only one in the team that has even touched Umbraco and upgraded DNN to the latest version and boom, I'm the upgrade guy :)
Hi Alexandru
It's easy, this is a first line:
And this is a second line:
In the first line, I would not recommend you using node name for retrieving the content, if somebody changes the name in the backend this logic will not work. Use Id or doctypeAlias for this logic or content picker on a root node.
Thanks,
Alex
Hi Alex,
Thank you for your response.
I've just noticed the answer was right there under my eyes in the documentation. Looks like I need glasses.
I understand the suggestion, makes sense, will look into it after I get it all up and running!
is working on a reply...