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
Trying to find how to get an items unique identifier - used to be an integer but now an Umbraco formatted string e.g. umb://document/4fed18d8c5e34d5e88cfff3a5b457bf2
I have an Author/Content set up and store the Author as a ContentPicker2 - which stores the item as the new UDI. However, I now have an Examine index set up to look at my Author property.
On the Author Profile page, I use this Examine Index to find the content attributed to that Author. How can I find the UDI of the Author's page to then pass to Examine?
Please let me know if what you propose requires a trip to the database as I'd prefer to avoid as many of those as possible!
Past days this code helped me a lot to get udi of iPublishedContent:
var modelWithKey = Model.Content.Unwrap() as IPublishedContentWithKey;
var key = modelWithKey.GetKey();
Thanks Alex - great solution!
I needed to do this on an APIController perceptive, discovered this today that seems to format the UDI properly, including getting rid of those pesky dashes from the guid
IPublishedContent page = _helper.UmbracoContext.ContentCache.GetById(1156);
var udi = new GuidUdi("document", Model.Content.GetKey());
Here is how I do it
Udi.Create(Constants.UdiEntityType.Document, "the guild key here")
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted