For my EditJob job template I want to access the title of a job document type property jobFunctionTitle. I would like to use a inline razor script in my template.
On the wiki I read there is a method to access a node by id where the id is passed by a querystring:
new DynamicNode(HttpContext.Current.Request.QueryString["id"])
Now my question is, how can I access the jobFunctionTitle property in my inline razor script, a use it in my template, something like:
<h2>Edit Job: [dynamic value for jobFunctionTitle]
I guess this must be plain simple, but I'm pretty inexperienced by using Razor in Umbraco Templates
ps: still working on this human resources site, but it's pretty big, lot's of interactive features for employers and jobseekers. It will be my biggest Umbraco website, feature wise.
how to get a doctype property value in a template
Hi,
For my EditJob job template I want to access the title of a job document type property jobFunctionTitle. I would like to use a inline razor script in my template.
On the wiki I read there is a method to access a node by id where the id is passed by a querystring:
new DynamicNode(HttpContext.Current.Request.QueryString["id"])
Now my question is, how can I access the jobFunctionTitle property in my inline razor script, a use it in my template, something like:
<h2>Edit Job: [dynamic value for jobFunctionTitle]
I guess this must be plain simple, but I'm pretty inexperienced by using Razor in Umbraco Templates
Thanks for your help,
Anthony
Hi Anthony,
There is a function Library.NodeById that you can use to get a node from it's ID. This should do the trick:
HTH,
Tom
Hi Tom,
Thanks a lot man, this works perfectly!
greetings,
Anthony
ps: still working on this human resources site, but it's pretty big, lot's of interactive features for employers and jobseekers. It will be my biggest Umbraco website, feature wise.
is working on a reply...