1

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!

MackeiaN
  • 61
  • 7
  • Would be a lot easier to answer if you'd tell us how you're trying to access the property. Also, remember the dynamic property has to be set on the page or on a parent page. – Tchami Feb 29 '12 at 19:44
  • Also be sure to not use the same property name on a regular property. – Johan Kronberg Feb 29 '12 at 20:44

2 Answers2

0

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.

Jason
  • 3,599
  • 10
  • 37
  • 52
  • Good answer but that one I knew. I'm sorry if I was unclear in my description. It turned out to be an whole other problem. – MackeiaN Mar 01 '12 at 15:14
  • Glad you got it worked out. You should probably click the tick beside the appropriate answer to indicate that your query has been resolved. – Jason Mar 01 '12 at 16:04
  • Yes, because of my new account here I cannot do that until 2 more hours=) – MackeiaN Mar 02 '12 at 13:27
0

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!

MackeiaN
  • 61
  • 7