Etiketter - .NET

CMS 6 crashes using Page Type Builder

Page Type Builder (PTB) is an open source project developed by Joel Abrahamsson that changes the way of working with page templates in EPiServer quite a bit: “Page Type Builder allows developers to define EPiServer page types in code which eliminates the need to synchronize page types between different servers. As page types are declared in code it also enables inheritance between page types and strongly typed property access.”

Of course we wanted to use PTB and CMS 6 for our new project. We went to work but soon discovered that something did not really work. When looking on our PageTypes in admin mode, some of them caused the UI to crash.

It turns out that the UI for CMS 6 (Admin/EditPageType.aspx) does not accept that the help text for any property is null which is the default value for it using PTB. A quick solution would be to change the EPiServer templates to take care and use an empty string when there is a null value. In practice this means:

Change line 81 in EditPageType.aspx from

<%# EPiServer.Core.LanguageManager.Instance.TranslateFallback("/pagetypes/common/property[@name='" + DataBinder.Eval(Container.DataItem, "Name") + "']/help”, DataBinder.Eval(Container.DataItem, “HelpText”).ToString())%>

to

<%# EPiServer.Core.LanguageManager.Instance.TranslateFallback("/pagetypes/common/property[@name='" + DataBinder.Eval(Container.DataItem, "Name") + "']/help”, DataBinder.Eval(Container.DataItem, “HelpText”) == null ? “” : DataBinder.Eval(Container.DataItem, “HelpText”).ToString())%>

but we do not know if CMS 6 will try to access help text anywhere else without checking for null. So we went on by changing PTB:

In the file

/Synchronization/PageTypePropertyUpdater.cs

in the method

CreateNewPageDefinition

we changed from

pageDefinition.HelpText = propertyDefinition.PageTypePropertyAttribute.HelpText;

to

pageDefinition.HelpText = propertyDefinition.PageTypePropertyAttribute.HelpText ?? "";

and in the method

UpdatePageDefinitionValues

we changed

pageDefinition.HelpText = propertyAttribute.HelpText;

to

pageDefinition.HelpText = propertyAttribute.HelpText ?? "";

Hopefully this will help someone. We will continue to post here if we run in to any other issue that could be of interest along the way.

So far we are very pleased with PTB and CMS 6 working together and we are looking forward to releasing some great sites using them.

Etiketter: , , , ,

3 Kommentarer

Fans1.com - Fotboll i Kina

fans1I början av april 2008 lanserades nyhetsvertikalen och fotbollscommunityt Fans1.com i Kina. Sajten riktar sig till den kinesiska marknaden och drivs av ett europeiskt/kinesiskt team i Beijing. Isotop har byggt tjänsten tillsammans med Fans1.com:s eget utvecklingsteam och med EPiServer CMS 5 som plattform för publicering och rättighetshantering, har redaktörsteamnet på ett år publicerat mer än 32 000 artiklar! Sajten finns bara på kinesiska, driftas i Kina och siktar på en ledande position som oberoende onlinetjänst för kinesiska fotbollsfans. Grattis på ettårsdagen Fans1.com!

Etiketter: , ,

Nytt intranät till 3

Isotop har migrerat det befintliga intranätet hos 3, en av Sveriges ledande 3G-operatörer, till en helt nyutvecklad EPiServer-lösning. Under projektet genomfördes en automatiserad migrering av allt innehåll från det gamla Roxen-baserade intranätet. Det nya intranätet är helt integrerat med beintliga katalogtjänster (Active Directory) på 3, vilket möjliggör en effektiv användarhantering.

Intranätet används av över 300 personer i 3 länder.

För mer information, kontakta Stefan Jansson.

Etiketter: , , ,