November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
Hi
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.
Regards
Per Gunsarfs
EPiServer Development Team
I've extended the property control to have child controls, like this:
<Deane:SuperFantasticProperty PropertyName="PageName" runat="server">
<Deane:SomeChildControl foo="bar"/>
</Deane:SuperFantasticProperty>
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...
Regards
Per Gunsarfs
Per:
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
base.Render(writer);
//This does not execute dynamic content (assume "Text" is a string which contains the dynamic content SPAN)
writer.Write(Text);
}
I got it. I needed to call these two methods from within my Render override.
EnsurePropertyControlsCreated();
RenderChildren(writer);
Man, I can't tell you how valuable it is that your code is not obfuscated...
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?