I have created two Sitecore templatates MenuItem and MainNavigation. I have created two interfaces wich are based on these templates:
[SitecoreType(TemplateId = "{C824E484-F4A6-475C-AFAF-308FF4BBA5A9}", AutoMap = true)]
public interface IMenuItem
{
string Title { get; set; }
IEnumerable<IMenuItem> SubMenuItems { get; set; }
}
[SitecoreType(TemplateId = "{68947CC0-7658-4188-889D-4E88B84F3BC2}", AutoMap = true)]
public interface IMainNavigation
{
IMenuItem MenuHeaderItem { get; set; }
IEnumerable<IMenuItem> MenuItems { get; set; }
}
The mapping MenuItems from an MultiList is working. The mapping MenuHeaderItem from an Droplist is not. In the template I have provided an query in the datasource so only MenuItems can be selected.
How can I make this mapping work?
I've tried v4.0.5.54 and now I have updated to version 4.2.1.188
I have found the answer myself. In the template I have to use sitecore type Droplink instead of DropList.
Droplist only stores the selected item name as a string. Droplink also stores the GUID.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With