How do I get the current page from a new Grid Layout?
Hello.
I've made my own grid layout page - a copy of Bootstrap3.cshtml. I'm trying to get the current page (or a specific page). How can I do that? Looks like it needs "Umbraco.Web.Mvc.UmbracoTemplatePage", but this isn't a template. Any ideas?
Sorry Leon but I dont think your answer is correct because you are getting all pages with the same name ? so if you got more nodes in backend called the same as your homepage it will get more results back, for the most part I would guess it always will be the first in the list because you had created the homepage first, but I dont like the way you get the node because there is a possible risk it will get the worng node..
I was looking for a way to get the current page inside my grid framework. I tried your solution, but for what I was trying to accomplish that solution did not help me.
I found another way, including this line inside my framework grid:
How do I get the current page from a new Grid Layout?
Hello.
I've made my own grid layout page - a copy of Bootstrap3.cshtml. I'm trying to get the current page (or a specific page). How can I do that? Looks like it needs "Umbraco.Web.Mvc.UmbracoTemplatePage", but this isn't a template. Any ideas?
Leon
I found out how - from stack overflow.
http://stackoverflow.com/questions/15925076/umbraco-get-node-by-name-and-datatype
Leon
Sorry Leon but I dont think your answer is correct because you are getting all pages with the same name ? so if you got more nodes in backend called the same as your homepage it will get more results back, for the most part I would guess it always will be the first in the list because you had created the homepage first, but I dont like the way you get the node because there is a possible risk it will get the worng node..
I like Marcelo version insted ! :D
Hi Leon,
I was looking for a way to get the current page inside my grid framework. I tried your solution, but for what I was trying to accomplish that solution did not help me.
I found another way, including this line inside my framework grid:
As I don't know Umbraco very well, Please, someone could confirm if this approach is acceptable? Will I have problems in future for my website?
Thanks
is working on a reply...