I have a custom controller to send a message. Therefore, I need to get the value of the property field name and alias = "email", this will be used to send email.
this code below works
var id = umbraco.uQuery.GetNodeByUrl("/contact-us");
IPublishedContent root = Umbraco.TypedContent(id.Id);
return root.GetProperty("email", true).Value.ToString();
However, the problem here is that if the page name changes, the URL will change and the code will break.
So, how can I modify the above code to get the current page id and paste it here (???) ;?
I think the code should be something like this:
IPublishedContent root = Umbraco.TypedContent(???);
return root.GetProperty("email", true).Value.ToString();
Any help would be appccciated
source
share