WFFM uses the above class as an <initialize> pipeline processor. You can see this defined in Sitecore.Forms.Mvc.config:
As an experiment I whipped up the following class to do just that:
I then glued everything together using a patch configuration file:
I’m adding the <initialize> pipeline processor shown above after WFFM’s though theoretically you could add it anywhere within the <initialize> pipeline.
For testing, I built the following View — it uses some helpers to render the <link> and <script> tags for the bundles — and tied it to my Layout in Sitecore:
@using System.Web.Optimization @using Sitecore.Mvc @using Sitecore.Mvc.Presentation <!DOCTYPE html> <html> <head> <title></title> @Styles.Render("~/wffm-bundles/styles.css") @Scripts.Render("~/wffm-bundles/scripts.js") </head> <body> @Html.Sitecore().Placeholder("page content") </body> </html>
I then built a “Feedback” form in WFFM; mapped it to the “page content” placeholder defined in the View above; published it; and pulled it up in my browser. As you can see the code from the Uniform project styled the form:
For comparison, this is what the form looks like without the <initialize> pipeline processor above:
Mike this will help but when bundling sequence and media type is important. The simplest case is to bundle screen media type and print media type css file separately. This of course can get complicated depending on the markup provided. Do you have any provision for media types for css?
Wish I had a good answer for this but my front-end skills have atrophied. 😦
Interesting approach! I have been tapping into the initialize pipeline using straight web optimization framework for bundling. The way I had it set up is that it would read the file system in alphabetical order and for each folder in root it would create a bundle. This configuration could be modified to do something similar. For now it looks like you would have to create a processor per CSS and js pair.