Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Iam trying to get some data from the documention type.
I have found this solution :
But is it best pratice? IT is fine to write "aDGroupName" because it is a alias that i haved created. But what about the "umbracoHelper.Content(2921)", because i am hardcoding the id. But what can i do alternativ?
Hi Li JC
What Umbraco version are you using?
It's better to use Models Builder, check out docs - https://our.umbraco.com/documentation/reference/templating/modelsbuilder/
With Models Builder you will have IntelliSense so you don't need to hardcode a property alias.
Another question to you, where do you use this code?
If it's in view or Umbraco controller you don't need to instantiate UmbracoHelper class, the instance is accessible just by Umbraco.
Iam using it at controller
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted