At what point in the Property control lifecycle does Dynamic Content do its thing? If I override the Property control and do some string manipulation before calling Render, do I have to be concerned with anything? So long as I don't alter the SPAN tag that represents the dynamic content, will it execute just fine?
Maybe Paul or someone who knows it even better than I can answer more in depth, but the dynamic content rendering in triggered from CreateDefaultControls, which is executed from CreateChildControls.
I don't think there should be any problems as long as you leave the SPAN tag alone. We split the xhtml content into fragments when rendering, and the SPAN tag will be the Dynamic Content fragment. So don't mess with it, and I can't see any problem.
Per GunsarfsEPiServer Development Team
I've extended the property control to have child controls, like this:
<Deane:SuperFantasticProperty PropertyName="PageName" runat="server">
The child controls are parse via a "ParseChildren" attribute. This apparently overrides the CreateChildControls method, and dynamic content no longer executes.
Any idea how I can have my cake and eat it too?
Well, I'm guessing a bit here, but I think you need to make sure that the CreateCreateDefaultControls, CreateOnPageEditControls and CreateEditControls are called in the correct situations. It's those methods on the property controls that renders our properties in the "correct" way. We do that in the CreateChildControls of the PropertyDataControl.
If you want to handle the xhtml string yourself you need to use the PropertyXhtmlString.StringFragments property to get the rendering of things like dynamic content and permanent links right.
Hmm, not sure if I'm helping or confusing you...
I've narrowed it does to the Render method. The base method (on the Property) control executes dynamic content. My override does not.
protected override void Render(HtmlTextWriter writer)
//This executes dynamic content
//This does not execute dynamic content (assume "Text" is a string which contains the dynamic content SPAN)
I got it. I needed to call these two methods from within my Render override.