Lee Crowe
May 4, 2011
  3157
(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
Opti ID overview

Opti ID allows you to log in once and switch between Optimizely products using Okta, Entra ID, or a local account. You can also manage all your use...

K Khan | Jul 26, 2024

Getting Started with Optimizely SaaS using Next.js Starter App - Extend a component - Part 3

This is the final part of our Optimizely SaaS CMS proof-of-concept (POC) blog series. In this post, we'll dive into extending a component within th...

Raghavendra Murthy | Jul 23, 2024 | Syndicated blog

Optimizely Graph – Faceting with Geta Categories

Overview As Optimizely Graph (and Content Cloud SaaS) makes its global debut, it is known that there are going to be some bugs and quirks. One of t...

Eric Markson | Jul 22, 2024 | Syndicated blog

Integration Bynder (DAM) with Optimizely

Bynder is a comprehensive digital asset management (DAM) platform that enables businesses to efficiently manage, store, organize, and share their...

Sanjay Kumar | Jul 22, 2024

Frontend Hosting for SaaS CMS Solutions

Introduction Now that CMS SaaS Core has gone into general availability, it is a good time to start discussing where to host the head. SaaS Core is...

Minesh Shah (Netcel) | Jul 20, 2024

Optimizely London Dev Meetup 11th July 2024

On 11th July 2024 in London Niteco and Netcel along with Optimizely ran the London Developer meetup. There was an great agenda of talks that we put...

Scott Reed | Jul 19, 2024