November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
You can define your element which require client resource, then just declare the resources path. Forms will load your resources automatically. Please sample here: https://github.com/episerver/EPiServer.Forms.Samples/blob/master/Implementation/Elements/AddressesElementBlock.cs
(The method GetExtraResources)
How would this work for the built in form elements that require that the default javascript get loaded? I'm not trying to load additional client resourcves, just the ones required for all epi form elements of type FormContainerBlock.
Would I need to override each built in form element. I'm current trying to loop over all the current page blocks and determine if any are of type FormContainerBlock. My issue is that I can't figure out how to get blocks for XHtmlString and ContentAreas before the page saving event. Right now I'm using the page Saved event and getting page SoftLinks to deterine if any are of type FormContainerBlock.
How would I to inject Client Resources in a common Layout for only those pages that actaully contain an epi Form? If I add these to the header and footer, everything works. My concern is that I only want to inject them for pages that contain a form block.
@Html.RequiredClientResources(RenderingTags.Header)
@Html.RequiredClientResources(RenderingTags.Footer)