We wanted to have a collection of link buttons that the editor could use; add one or more links to add to a block. Further; the editor should have the possibility to select appearence on each link separately; Primary, Secondary or TextLink.
With that I ruled out the PageLinkCollection. Instead I tried an IList<CustomLinkObject> where the CustomLinkObject looked like this:
public class CustomLinkObject
{
public LinkItem LinkItem { get; set; }
public LinkStyle Style { get; set; }
}
First time I did this something broke and I was not able to use this solution.
I therefor did like this:
public class CustomLinkObject
{
public EPiServer.Url Link { get; set; }
public string LinkText { get; set; }
public LinkTarget Target { get; set; }
public LinkStyle Style { get; set; }
}
This met my requirements.
However on the downside; The editor is not informed about the block/page being affected when opening the Handle expiration and archiving modal on the linked page.
I can see that ContentArea, PageLink, PageLinkCollection and link in Xhtmlstring separately would be do that but not in an IList.
The question: Am I restricted to stated property types above to be notified on any broken links etc or is there other ways?