Multiple page selector

Vote:
 

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?

#86305
May 19, 2014 3:35
Vote:
 

Have you looked at this blog post ?
http://bergdaniel.se/episerver-multi-page-select-property

#86308
May 19, 2014 9:53
Vote:
 

Couldn't the built in LinkCollection be used?

#86312
May 19, 2014 10:47
Vote:
 

Completely forgot about LinkCollection. Thanks, Petter!

#86345
May 19, 2014 19:44
Vote:
 

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 

#151602
Jul 30, 2016 19:56
Vote:
 

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. 

#151606
Edited, Jul 31, 2016 12:42
Vote:
 

What about a ContentArea? Also add the AllowedTypes attribute

[AllowedTypes(AllowedTypes = new [] { typeof(PageData })]

#151607
Jul 31, 2016 15:16
Vote:
 

...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. 

#151608
Jul 31, 2016 16:39
Vote:
 

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 :

content-reference-list-v04

Screen 2 :

#151621
Aug 01, 2016 9:44
Vote:
 

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.

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

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

#151624
Aug 01, 2016 12:44
Vote:
 

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 ?

#151726
Aug 04, 2016 20:36
Vote:
 

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; }
#151937
Aug 10, 2016 16:05
Vote:
 

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 . 

#151939
Aug 10, 2016 16:48
Vote:
 

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.

#151940
Aug 10, 2016 16:56
Vote:
 

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 ?

#151947
Aug 10, 2016 19:18
Vote:
 

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:

http://world.episerver.com/documentation/Items/Developers-Guide/Episerver-CMS/8/Content/Properties/Custom-properties/

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.

#152048
Aug 15, 2016 3:09
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.