I created a Selector Factory:
public class RobotsMethodsFactory : SelectorFactory<string>
{
public override IEnumerable<SelectorItem<string>> Options =>
new List<SelectorItem<string>>()
{
new SelectorItem<string>() { Value = "index", Title = "Index"/*, Description = "Tells a search engine to index a page."*/},
new SelectorItem<string>() { Value = "noindex", Title = "NoIndex"/*, Description = "Tells a search engine not to index a page."*/},
new SelectorItem<string>() { Value = "follow", Title = "Follow"/*, Description = "Even if the page isn’t indexed, the crawler should follow all the links on a page and pass equity to the linked pages."*/},
new SelectorItem<string>() { Value = "nofollow", Title = "NoFollow"/*, Description = "Tells a crawler not to follow any links on a page or pass along any link equity."*/},
new SelectorItem<string>() { Value = "noimageindex", Title = "NoImageIndex"/*, Description = "Tells a crawler not to index any images on a page."*/},
new SelectorItem<string>() { Value = "none", Title = "None"/*, Description = "Equivalent to using both the NoIndex and NoFollow tags simultaneously."*/},
new SelectorItem<string>() { Value = "noarchive", Title = "NoArchive"/*, Description = "Search engines should not show a cached link to this page on a SERP."*/},
new SelectorItem<string>() { Value = "nocache", Title = "NoCache"/*, Description = "Same as NoArchive, but only used by Internet Explorer and Firefox."*/},
new SelectorItem<string>() { Value = "nosnippet", Title = "NoSnippet"/*, Description = "Tells a search engine not to show a snippet of this page (i.e. meta description) of this page on a SERP."*/},
new SelectorItem<string>() { Value = "unavailable_after", Title = "Unavailable_After"/*, Description = "Search engines should no longer index this page after a particular date."*/}
};
}
But when I use the selector factory:
[SelectorProperty("Robots" , selectorFactory:typeof(RobotsMethodsFactory), TabGroup = "Search Engine Optimization")]
public virtual SelectorProperty<string> Robots { get; set; }
I get the error "Unable to cast object of type 'Newtonsoft.Json.Linq.JObject' to type 'Kaliko CMS.Core.PropertyData'."
Anyone else encountered this, and what am I doing wrong?