Have you looked at this blog post ?
http://bergdaniel.se/episerver-multi-page-select-property
Is the issue Resolved ? Actually the LinkItemCollection is not actually matches to my requirement .I want to select multiple items in Sitemap itself by using pagereference ...How ? Please suggest ?
Is there is any ready available property for me
Linkitemcollection was the way to go earlier but requires some extra work to get to the actual ContentReference. Now you can also use the new ContentReferenceList property type.
What about a ContentArea? Also add the AllowedTypes attribute
[AllowedTypes(AllowedTypes = new [] { typeof(PageData })]
...or the old school trick with a special container pagetype that contains the items you need (probably a special link page type for you with a single content reference as a target) and then point out the container with a content reference where you want to use it. Mostly useful if you might expand the model for the links to contain additional information. Then you can simply add that to the specialized page type for the links.
Many Thanks for your swift responses . I have been through the suggestions one by one
@ Daniel @Alf : Suggested to go with the ContentReferenceList property , but the problem is the user have to select the one page after the other ,instead of all at once . Also the UI of the ContentReferenceList doesnot feel good. (Screen 1 ) http://blog.huilaaja.net/2015/08/19/contentreferencelist-property-in-episerver-cms-8-6-0/ . Please correct me if iam wrong.
Actually what iam looking for is selecting multiple pages as in (Screen 2)
Screen 1 :
Screen 2 :
When i try with Ilist<PageReference>, i get this below run time error . Why ? Where the same works with Ilist<ContenetReference>
Server Error in '/' Application.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: EPiServer.Core.TypeMismatchException: Type 'System.Collections.Generic.IList`1[[EPiServer.Core.PageReference, EPiServer, Version=9.7.0.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7]]' could not be mapped to a PropertyDefinitionType
Is there any other ideas or updates to me . Requirement in simple is that to select the required Pages at a once.Is there is any limitation in episerver for this ?
Hi Sharoze!
Try using a IList of ContentReference and apply the AllowedTypes attribute to filter it down to pages only. It should be possible to apply an IList of PageReferences as well, but it is much more complex to do since you need to register this both with the core and the UI.
[AllowedTypes(new Type[] { typeof(PageData) })] public virtual IList<ContentReference> PageList { get; set; }
Hi Linus
Many Thanks for your reply !!!
I would like to go with LinkItemCollection .But i am unable to use the [AllowedTypes(typeof(PageType))] .The issue which iam getting is Allowed Types is not for Link ITEM Collection .Then what should i use to solve the issue .
Please help me in resolving the issue .
Hi!
Using the latest Nuget packages, this works fine. I even get a little nice indication that only pages are valid:
Try updating your packages to see if that solves your problem.
Hi Linus ,
The one which you have showed up is IList<ContentReference> . But iam referring to LINKITEMCOLLECTION .
http://world.episerver.com/documentation/class-library/?documentId=cms/7/bac0996a-3505-8e9a-5acf-59fd2a0eb8fb
Also , Iam unable to save any custom proerty , is this is a known issue ?
Hi!
The link item collection is, as the name states, a list of links. Think of this as URL:s, not internal references to other objects in Episerver. Of course, you can link to any object in Episerver that has a public URL. The link item collection has been somewhat used for referencing other objects in Episerver, but after the content reference list was introduced, there should be no need for this. Please try using a content reference list.
As to custom properties, Episerver needs to know each property type. By default, Episerver registers a number of different types, both primitives and also more complex types like ContentArea. If you want to create your own custom properties, you can read this information:
Please note that this is a pretty advanced subject that also requires you to either registester meta data for editing and also potentially creating your own custom editor. I would avoid this unless I had very specific needs and a budget that allowed for quite some time in this area.
I'd like to create a property that allows an editor to select multiple pages instead of just that one you get if you choose a "Page" property. Any experience from doing something like that?