Try our conversational search powered by Generative AI!

Anders Hattestad
Jun 17, 2010
(1 votes)

Itera.Objects, a extension for PageTypeBuilder

I have been looking and PageTypeBuilder, and the concept is great. But one thing I missed was the ability to add objects of all types and not only primitives or propertydata types.

I started by downloading the latest build, and looked around. The Interceptor get’s the value of a property and set’s it on the page object. I therefore had to create a property that was a wrapper around a object.  Before I have used Itera.MultiProperty to store many variables. This time I tried to use the dynamic data store, but after a couple of hours trying to set a setting on a property from code I switch over to saving them as real properties on the page.

These properties are disabled from edit mode, and I have a container property that shows these hidden properties.


When Page type builder finds this stuff It will create a 2 properties. But since PTB doesn’t follow type’s I have made a IInitializableModule that follows these types, and adds the hidden properties.



The property PropertyContainer will in a context of a strong Types page create the an instance of the object and populate all the primitives from the hidden property data. If it encounter another PropertyContainer it will create that object and populate it form it’s hidden properties.


There is actually 5 different properties, that will display a bit differently in edit mode.

  1. PropertyContainer
  2. PropertyContainerWithHelp
  3. PropertyContainerSmall
  4. PropertyContainerSmallNoBox
  5. PropertyContainerSmallWithHelp

If you specify different tab’s for the different properties the layout will also change.


will display in edit mode like this:




How cool is that :)

And even better, the tabs have access rights!

Code is available here

Jun 17, 2010


Sep 21, 2010 10:33 AM

Very cool!

Erik Nordin Wahlberg
Erik Nordin Wahlberg Sep 21, 2010 10:33 AM

Wow, this is really cool! To bad you did't find a way for using settings for properties via code. Have you talked with EPiServer about it?

Sep 21, 2010 10:33 AM

I sent a mail to Mr Smith :), but haven't got a replay. The logical step would to bind what kind of type the property should be as an value on the property setting. Instead I needed to find the PageType when you access the Value and find by reflection the type.
It could also be possible to save the inner values inside these property settings, but as it turned out there are a few benifitts of saveing them as real properties. Copy, Export and so on....
/ Anders Hattestad

Sep 21, 2010 10:33 AM

Seems like a good way to structure your pages into reusable components. Very cool!
/ Patrik Akselsson

Sep 21, 2010 10:33 AM

Wow, what a great idea and implementation.

This is, from a code perspective rather than a persistence perspective, really beginning to stretch the EPiServer model beyond simple dictionary based PropertyBags.

Probably a big ask, but is there any way to go further and allow strongly typed access to List and Collection types. This will obviously present difficulties unless those collections were serializable, but that functionality would really be valuable.

Sep 21, 2010 10:33 AM

There is a couple of ways of doing lists.
1) Itera.MultiProperty do save all sub properties as a string. The only issue is that we need a way populating the PageData object with it's value.
2) make a generic PropertyAnyClass class that use the ObjectDataStore. I have actully most of the implementasion ready, will post it as soon I can.

If any of you have managed to set a property setting on property from code, please let me know.
/ Anders Hattestad

Sep 21, 2010 10:33 AM

What email? I haven't seen anything from you Anders.
/ Paul Smith

Sep 21, 2010 10:33 AM

Guess it got cought in the crazy laughing programmer mail filter rule you have:)

was basicly a question about some example code for setting a property setting when all you had was the propertie def id

will resend
/ Anders Hattestad

Sep 21, 2010 10:33 AM

My bad.
Had an error in paul smith's epost adress , so you can stop searching your email server :)
/ Anders Hattestad

Joel Abrahamsson
Joel Abrahamsson Sep 21, 2010 10:33 AM

Really interesting stuff! Will take a closer look at it as soon as I can. I'm also very interested in your question to Paul, so perhaps you, Paul, could post your reply as a blog post?

Joel Abrahamsson
Joel Abrahamsson Sep 21, 2010 10:33 AM

Oh and I'd also love to hear more about your experiences of building on top of/plugging into Page Type Builder!

Sep 21, 2010 10:33 AM

Got an answar to how we should set properties on properties by code.
setting is the propertysetting class.

object setting=Activator.CreateInstance(EPiPropertySetting.PropertySettingType, EPiPropertySetting.PropertySettingArgument);
if (realProperty.SettingsID == Guid.Empty)
realProperty.SettingsID = Guid.NewGuid();
var settingsContainer = new PropertySettingsContainer(realProperty.SettingsID);

settingsContainer.AddSettings(new PropertySettingsWrapper
PropertySettings = setting as IPropertySettings,
DisplayName = EPiPropertySetting.PropertySettingType.Name,
IsGlobal = false,
IsDefault = false

new PropertySettingsRepository().Save(settingsContainer);
/ Anders Hattestad

Erik Nordin Wahlberg
Erik Nordin Wahlberg Sep 21, 2010 10:33 AM

Anders! I removed a property from code, and now it crashes on startup.

Line 221: return (this.ClassAttribute.EditCaption == null ? Name : (this.ClassAttribute.EditCaption+"["+this.Name+"]")) + " (is " + this.ClassPropertyType.Name + " render as " + EPiPropertyType.Name + ")";
in PropertyInfoAndData.cs returns a null reference.

Erik Nordin Wahlberg
Erik Nordin Wahlberg Sep 21, 2010 10:33 AM

Sorry, that was not the issue.

I added a new property of the type int, but i did not declare a Type=typeof(PropertyNumber) when doing that. It caused a null reference to EPiPropertyType.

Bjørn Gustafson
Bjørn Gustafson Jul 21, 2011 03:33 PM

I saw your comment on this post, regarding PageTypePropertyGroups in PageTypeBuilder 2:

I am using PageTypePropertyGroups, but I love what you have done here by visually grouping the properties together in edit mode. Nice job! :-)

Do you have a version of your code which works with the new PageTypePropertyGroups in PageTypeBuilder 2?

Oct 20, 2011 01:43 PM

Hi Bjorn

When PageTypeBuilder 2 is officially released I will release a new version of PageTypeBuilderUI. This will contain functionality similar to what Anders has done with his Itera.Objects project to lay the property group properties out in a nicer format.


Please login to comment.
Latest blogs
Optimizely and the never-ending story of the missing globe!

I've worked with Optimizely CMS for 14 years, and there are two things I'm obsessed with: Link validation and the globe that keeps disappearing on...

Tomas Hensrud Gulla | Apr 18, 2024 | Syndicated blog

Visitor Groups Usage Report For Optimizely CMS 12

This add-on offers detailed information on how visitor groups are used and how effective they are within Optimizely CMS. Editors can monitor and...

Adnan Zameer | Apr 18, 2024 | Syndicated blog

Azure AI Language – Abstractive Summarisation in Optimizely CMS

In this article, I show how the abstraction summarisation feature provided by the Azure AI Language platform, can be used within Optimizely CMS to...

Anil Patel | Apr 18, 2024 | Syndicated blog

Fix your Search & Navigation (Find) indexing job, please

Once upon a time, a colleague asked me to look into a customer database with weird spikes in database log usage. (You might start to wonder why I a...

Quan Mai | Apr 17, 2024 | Syndicated blog