I've googled this site and can't find a way to determine the node id of the the current node. Ideally I'd like to use @Model and determine the id, so I can pass to the NiceUrl function.
It seems much of Umbraco coding assumes you already know the node id.
If you are using visual studio as well the check out this really useful youtube video by Doug Robar about debugging and getting full intellisense on DynamicNode - helped me no end
I tried Visual Studio today. Had the site on a test server and had to pull the code back to my dev box and I could debug. Painly fully using Response.Write statements, lol... I need to point my local dev box to use the test server SQL database, so only the code needs to be synced (xcopy) back to test server. That should make debugging more convenient.
Now that I see what NiceUrl URLs look like, I want to NOT so nice URLs. I don't need the host name in the URL, but rather starting with "/" instead. For example, /Services and not http://hostname/Services. Is there an easy way from get the host name and strip that part from the URL? Perhaps the Request object?
I am using this to create a data driven menu for a jQuery Mobile site.
Get id of current node
I've googled this site and can't find a way to determine the node id of the the current node. Ideally I'd like to use @Model and determine the id, so I can pass to the NiceUrl function.
It seems much of Umbraco coding assumes you already know the node id.
use @Model.Id to get current id, and use @Model.Url to get current page's url
Check out http://our.umbraco.org/projects/developer-tools/razor-dynamicnode-cheat-sheet - it shows you all the properties and methods you have available on Model.
If you are using visual studio as well the check out this really useful youtube video by Doug Robar about debugging and getting full intellisense on DynamicNode - helped me no end
http://www.youtube.com/watch?v=NgnKy-VTimU&hd=1 ;
Good luck
J
I tried Visual Studio today. Had the site on a test server and had to pull the code back to my dev box and I could debug. Painly fully using Response.Write statements, lol... I need to point my local dev box to use the test server SQL database, so only the code needs to be synced (xcopy) back to test server. That should make debugging more convenient.
Now that I see what NiceUrl URLs look like, I want to NOT so nice URLs. I don't need the host name in the URL, but rather starting with "/" instead. For example, /Services and not http://hostname/Services. Is there an easy way from get the host name and strip that part from the URL? Perhaps the Request object?
I am using this to create a data driven menu for a jQuery Mobile site.
is working on a reply...