Hi All,
I have the following query:
DocumentHelper.GetDocuments()
.Type("MyCustom.Menu", q => q
.Columns("TopMenuItemsID", "MenuName"))
.Type("MyCustom.MenuItem", q => q
.Columns("MenuItemID", "MenuItemText", "MenuItemPage", "MenuItemIcon", "ExternalUrl"))
.OnSite(SiteContext.CurrentSiteName)
.Path("/My-header-menu")
.OrderBy("NodeLevel", "NodeOrder", "NodeName")
.Published();
I use the results, grabbing the first document with .FirstOrDefault(), which is my menu root, I loop through the items and their children using a recursive function.
when I attempt to:
var menuItem = new MenuItemViewModel
{
MenuItemText = childNode.GetValue("MenuItemText", "").ToString(),
MenuItemRelativeUrl = childNode.GetValue("MenuItemRelativeUrl", "").ToString(),
MenuItemIcon = childNode.GetValue<DocumentAttachment>("MenuItemIcon", null),
ExternalUrl = childNode.GetValue("ExternalUrl", "").ToString()
};
The MenuItemIcon is always null even when the MenuItem has a DocumentAttachment defined.