Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Umbraco - Finding Root Node in C#

Tags:

c#

umbraco

I'm working on a backend module, so Node.GetCurrent() is not an option. I need to find a way to call something like Node currentNode = new Node(parentNodeId); and get the root node of the site. I've seen samples in XSLT, but nothing for C#. Does anyone know how I can accomplish this?

Even just getting the ID of the root node so I can call new Node() would be great.

like image 524
Atom Avatar asked Aug 13 '12 18:08

Atom


1 Answers

The rootnode is always available as:

var rootNode = new Node(-1);
like image 110
E.J. Brennan Avatar answered Sep 19 '22 09:09

E.J. Brennan