I've been customizing _layout.cshtml a bit, and I'm trying to figure out how to get the doctype of the current node as a string. How can I accomplish this?
Also, I've had some trouble finding any documentation on Umbraco 5 - where can I go to find this kind of information in the future?
If I remeber correctly you should be able to do something like this..
var rootNode = currentPage.AncestorsOrSelf.Last(); var rootIsSelected = currentPage.Id == rootNode.Id<string>;
For more usefull Razor snippets to learn from make sure to checkout those snippets Warren has made here: https://gist.github.com/warrenbuckley - If you have an idea for more snippets I'm sure he would love to hear it on Twitter for instance.
Umbraco 5 - Get DocType of Current Node
I've been customizing _layout.cshtml a bit, and I'm trying to figure out how to get the doctype of the current node as a string. How can I accomplish this?
Also, I've had some trouble finding any documentation on Umbraco 5 - where can I go to find this kind of information in the future?
Hi Drew
If I remeber correctly you should be able to do something like this..
var rootNode = currentPage.AncestorsOrSelf.Last();
var rootIsSelected = currentPage.Id == rootNode.Id<string>;
For more usefull Razor snippets to learn from make sure to checkout those snippets Warren has made here: https://gist.github.com/warrenbuckley - If you have an idea for more snippets I'm sure he would love to hear it on Twitter for instance.
Regarding the documentation on v5 you should make sure to keep an eye on the official Umbraco blog here: http://umbraco.com/follow-us.aspx and Jonathan Saxon has made a good blog series about v5 here: http://h4rdboiledegg.wordpress.com/ and Darren Ferguson is writing about how he is converting his current site to Umbraco 5 here: http://blog.darren-ferguson.com/ and Shannon from the core team is also writing some interesting stuff about v5 http://shazwazza.com/
Make sure to keep an eye out on the blog tracker on the last column to the right of our too. That's the best you can do right now I believe.
Hope this helps.
/Jan
is working on a reply...