May 4, 2011
  3350
(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 Commerce Connect: Enabling content-driven ecommerce experiences

The world of ecommerce today is a rapidly evolving field. No longer are customers satisfied with a long list of products that they have no idea how...

Shahrukh Ikhtear | Jun 16, 2025

Create a multi-site aware custom search provider using Search & Navigation

In a multisite setup using Optimizely CMS, searching for pages can be confusing. The default CMS search regardless of search provider does not...

dada | Jun 12, 2025

Tunning Application Insights telemetry filtering in Optimizely

Application Insights is a cloud-based service designed to monitor web applications, providing insights into performance, errors, and user behavior,...

Stanisław Szołkowski | Jun 12, 2025 |

JavaScript SDK v6: Lightest, Most Efficient SDK Yet

Need a faster site and less frontend bloat? JavaScript SDK v6 is here —and it’s the lightest, smartest SDK we’ve ever released for Optimizely Featu...

Sarah Ager | Jun 11, 2025