Try our conversational search powered by Generative AI!

Property Type: Multiple Page References?


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?




Jun 05, 2012 17:43

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   

Jun 05, 2012 22:16

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.

Edited, Jun 07, 2012 20:29
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.