AI OnAI Off
You can certainly convert a LinkItem to a PageReference:
public static PageReference ToPageReference(this LinkItem linkItem)
{
var url = new UrlBuilder(linkItem.Href);
if (PermanentLinkMapStore.ToMapped(url))
{
var pageReference = PermanentLinkUtility.GetPageReference(url);
if (!PageReference.IsNullOrEmpty(pageReference))
{
return pageReference;
}
}
return PageReference.EmptyReference;
}
There is also a custom property that might meet your needs https://www.coderesort.com/p/epicode/wiki/Itera.MultiProperty
Thanks for pointing out the MultiProperty item out to me. While the properties in EPiServer from Itera were exactly what I was looking for, I couldn't exactly get it to work with PageTypeBuilder in the code. That did it led me down a road where I did find a solution. While I might have been able to resolve my issues Itera.MultiProperty, I ended using ElencySolutions.MultipleProperty. It is way overkill for what I need it for, but it gets the job done. http://world.episerver.com/Blogs/Lee-Crowe/Dates/2011/3/ElencySolutionsMultipleProperty-v10-Released/
I'm sorry if this is very basic, or I am just not seeing it. I am still fairly new to EPiServer.
I guess I'm sort of looking for something that is a combination of "Link Collection" and "Page". I want to be able to select multiple page in a single property. I originally thought "Link Collection" would meet my needs, but unfortunately it does not. It does not allow me to select items that live outside the HomePage, and the returned values to not allow to get get a PageReference to an item.(Correct me if I am wrong and mistaken)
Is there a PropertyType that will meet my needs? Or will I have to create a Custom Property?
Thanks,
-Chris