November Happy Hour will be moved to Thursday December 5th.

Lee Crowe
May 4, 2011
  3211
(1 votes)

EPiServer FilteredPageReference Property Controls v1.3 Released

For those of you who are not aware of the Filtered Page Reference property controls I have created please refer to the following two blog posts:

Missing Feature

One of the features that was irritating me a bit about the FilteredPageReference property controls I created was their inability to function correctly when they were not page property definitions of a page type.

For example if the property was added programmatically to a page for editing or used by my Multiple Property Controls any property settings set against the property would be lost as they were not persisted through the various popup dialogs.

The Solution

v1.3 of the assembly persists the property settings in the users session if the property instance does not belong to a PageData object.  This ensures that any property settings set either by using my Multiple Property Controls or possibly by the next version of PageTypeBuilder (if it will allow property settings to be programatically defined against a page type property.  Joel will this be in the next version?) will be persisted through the various dialogs and the filtered page picking functionality will be consistent wherever it is used. Although session may not be the best solution it was the simplest to implement.

Code Example

The code example below demonstrates how you would programmatically set the FilteredPageReference property settings while using a property that is based on the Multiple Property Controls.

   1:  namespace EPiServer.Entities
   2:  {
   3:      using System;
   4:      using System.Runtime.Serialization;
   5:      using Core;
   6:      using ElencySolutions.MultipleProperty;
   7:      using FilteredPageReference;
   8:      using PageTypes;
   9:      using SpecializedProperties;
  10:   
  11:      [Serializable]
  12:      [DataContract]
  13:      [KnownType(typeof(Entity))]
  14:      public class Entity
  15:      {
  16:   
  17:          [MultiplePropertyEntityProperty(Caption = "Filtered Page Reference",
  18:              Type = typeof(PropertyFilteredPageReference),
  19:              SortIndex = 100,
  20:              Required = false,
  21:              PropertySettingsCreator = typeof(FilteredPageReferenceSettingsCreator))]
  22:          [DataMember]
  23:          public PageReference FilteredPageReference { get; set; }
  24:   
  25:          [MultiplePropertyEntityProperty(Caption = "Filtered Page References",
  26:              Type = typeof(PropertyFilteredLinkCollection),
  27:              SortIndex = 110,
  28:              Required = false,
  29:              PropertySettingsCreator = typeof(FilteredPageReferenceSettingsCreator))]
  30:          [DataMember]
  31:          public LinkItemCollection FilteredLinkCollection { get; set; }
  32:   
  33:      }
  34:   
  35:      public class FilteredPageReferenceSettingsCreator : IMultiplePropertySettingsCreator
  36:      {
  37:          public Core.PropertySettings.IPropertySettings CreatePropertySettings()
  38:          {
  39:              PropertyFilteredPageReferenceSettings settings = new PropertyFilteredPageReferenceSettings
  40:              {
  41:                  AllowedPageTypesAndInterfaces = new[]
  42:                                                      {
  43:                                                          typeof(ImageMapPageType), 
  44:                                                          typeof(HotSpotPageType)
  45:                                                      },
  46:                  AllowQuickEdit = true,
  47:                  StartFromCurrentPage = true
  48:              };
  49:              
  50:              return settings;
  51:          }
  52:      }
  53:   
  54:  }

Installation and Setup

The FilteredPageReference assembly will only work with EPiServer CMS 6 and onwards.

To install just simply place the assembly into your web applications bin folder.  The assembly can be downloaded from

http://episerverfpr.codeplex.com/.

 

Have feedback?

Please feel free to email or twitter me with any feedback @croweman

May 04, 2011

Comments

Please login to comment.
Latest blogs
Optimizely SaaS CMS + Coveo Search Page

Short on time but need a listing feature with filters, pagination, and sorting? Create a fully functional Coveo-powered search page driven by data...

Damian Smutek | Nov 21, 2024 | Syndicated blog

Optimizely SaaS CMS DAM Picker (Interim)

Simplify your Optimizely SaaS CMS workflow with the Interim DAM Picker Chrome extension. Seamlessly integrate your DAM system, streamlining asset...

Andy Blyth | Nov 21, 2024 | Syndicated blog

Optimizely CMS Roadmap

Explore Optimizely CMS's latest roadmap, packed with developer-focused updates. From SaaS speed to Visual Builder enhancements, developer tooling...

Andy Blyth | Nov 21, 2024 | Syndicated blog

Set Default Culture in Optimizely CMS 12

Take control over culture-specific operations like date and time formatting.

Tomas Hensrud Gulla | Nov 15, 2024 | Syndicated blog

I'm running Optimizely CMS on .NET 9!

It works 🎉

Tomas Hensrud Gulla | Nov 12, 2024 | Syndicated blog

Recraft's image generation with AI-Assistant for Optimizely

Recraft V3 model is outperforming all other models in the image generation space and we are happy to share: Recraft's new model is now available fo...

Luc Gosso (MVP) | Nov 8, 2024 | Syndicated blog