Umbraco 5.0 - Proper way to check if a node is deleted
Hi!
I'm iterating through a list of articles with an optional author associated with a Content Picker. Some authors have been deleted from the content tree, but they are still referenced in the articles while they are in the Recycle Bin. Since they are no longer published, referencing article.Url will throw an exception. After emptying the Recycle Bin, the Content Picker reference changes to "Unknown" (not empty/undefined?), and I get another exception.
What is the proper way to check if a node set with a Content Picker is either in the Recycle Bin or completely deleted?
Below is a simplified example of my code:
foreach (var article in articles) { var author = Umbraco.GetDynamicContentById(article.author); @if (author != null) { <li><a href="@author.Url">@author.Name</a></li> } }
Umbraco 5.0 - Proper way to check if a node is deleted
Hi!
I'm iterating through a list of articles with an optional author associated with a Content Picker. Some authors have been deleted from the content tree, but they are still referenced in the articles while they are in the Recycle Bin. Since they are no longer published, referencing article.Url will throw an exception. After emptying the Recycle Bin, the Content Picker reference changes to "Unknown" (not empty/undefined?), and I get another exception.
What is the proper way to check if a node set with a Content Picker is either in the Recycle Bin or completely deleted?
Below is a simplified example of my code:
is working on a reply...