I’m currently stuck on getting the URL for a content picker in a macro.
The selected content gets passed this way:
umb://document/03169b0b86e94768b0642bba0de24a68
Unfortunately, all posts about how to translate this to an URL or IPublishedContent seem to use old APIs like ToPublishedContent() or seem to be hacky or require injecting services and multiple calls to them.
I got as far as getting an IContent object from the umb-URL:
var target = Udi.Parse(Model.MacroParameters["target"] as string) as Umbraco.Core.GuidUdi;
var targetNode = Services.ContentService.GetById(target.Guid);
What is the official way to translate the UDI to an URL inside a macro? Pretty sure there has to be an easy and intuitive way.
This is a companion discussion topic for the original entry at https://our.umbraco.com/forum/104585-translating-umb-from-content-picker-in-macro-to-actual-url