Question

We have some issues with Dynamic Properties in EPiServer (CMS 6 R1). I have created a Dynamic Property that I use on a page. Unfortunately the property is null on existing pages. If I create a brand new page or even make a copy an existing page the Dynamic Property is working just fine.

Does anyone have some experience of dynamic properties on existing pages? Feels like something old is saved somewhere. I have searched the database but unable to find anything to remove that makes a difference.

Edit: Thanks for the comments. I've tried to set property in both the page itself and it's parent. Then I use CurrentPage["fooproperty"] to access it. There are not other properties named "fooproperty" either, I've tried some different property names, but they're all null on existing pages. If I create a new page of the same type, the dynamic property works just fine.

Thankful for your help!

Was it helpful?

Solution 2

I managed to solve this one. In this case Dynamic Properties worked just fine. The problem was in the tailor-made friendly-Url solution that was used.

Pages can have different friendly-URL's. Some urls use EPiServer's UrlRewriter and accessing the page from those URL's the CurrentPage property was as expected.

For other urls (to the same page) they use a overriden UrlRewriter, which actually takes a template-page (not the actual page) and populate it with data. That mean that using the CurrentPage will not give the actual page, but the template page (located in a completely different place).

A little messy but know I know. Thanks for the comments and answers!

OTHER TIPS

When a new dynamic property is added, existing pages have no data for that property and therefore the property bag does not contain a value for the new property.

For these existing pages, you need to set the value of a new dynamic property on the pages themselves or on an ancestor page (remembering to check the box to set this value for child pages).

The app may need restarting/recycling to flush the cached PageData instances before you see the property in the PageData propertybag.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top