Who to define DocumentType for UmbracoPropertyType.RelatedLinks
I have the following Document type property declaration:
[DocumentTypeProperty(UmbracoPropertyType.RelatedLinks, Name = "Quick links", Description = "Footer links to interesting parts of site", Tab = DocumentTypes.Tabs.TabNames.Footer)] public object QuickLinks { get; set; }
Do I need to use the Custom Data Types method to get a list of the link items, or is there a built in way of getting the items as a List?
You'll need to create something that implements ICustomTypeConvertor (as described in that tutorial) to transform the result from Umbraco into whatever data structure you're looking for.
How you register that depends on which version of uSiteBuilder you're using (recent versions require you to register it on the DocumentTypeProperty attribute like below).
[DocumentTypeProperty(UmbracoPropertyType.RelatedLinks, CustomTypeConvertor=typeof(YourCustomTypeConvertor), Name="Quick links",Description="Footer links to interesting parts of site", Tab=DocumentTypes.Tabs.TabNames.Footer)]
I started to implement this with uSiteBuilder 1.2, and it complained that the converter was already implemented, so I just needed to do:
[DocumentTypeProperty(UmbracoPropertyType.RelatedLinks, Name = "Quick links", Description = "Footer links to interesting parts of site", Tab = DocumentTypes.Tabs.TabNames.Footer)] public List<Vega.USiteBuilder.Types.RelatedLink> QuickLinks { get; set; }
Who to define DocumentType for UmbracoPropertyType.RelatedLinks
I have the following Document type property declaration:
Do I need to use the Custom Data Types method to get a list of the link items, or is there a built in way of getting the items as a List?
Thanks
Richard
You'll need to create something that implements ICustomTypeConvertor (as described in that tutorial) to transform the result from Umbraco into whatever data structure you're looking for.
How you register that depends on which version of uSiteBuilder you're using (recent versions require you to register it on the DocumentTypeProperty attribute like below).
Stephen
Thanks for that.
I started to implement this with uSiteBuilder 1.2, and it complained that the converter was already implemented, so I just needed to do:
Cheers
Richard
is working on a reply...