| Version 2 (modified by cfgrok, 16 years ago) |
|---|
Scaffolds: Customizing Scaffold .XSL Files
It's possible to entirely change the View CFML that scaffold tags generate. All involve editing .XSL files, which is way beyond the scope of this guide, but not altogether complicated.
There are three ways to customize the .XSL:
Editing Default .XSL files
If you explore the /ModelGlue/unity/xsl directory, you'll see that there are .XSL files that define the CFML to be generated when a like-named scaffold is added to an application.
Editing these directly changes the behavior of all of your Model-Glue applications.
Creating New .XSL files
By creating your own .XSL files, you can again change the behavior of all scaffolds in all Model-Glue applications. To "tell" a given scaffold to use your custom .XSL file, do the following:
- Open /ModelGlue/unity/config/Configuration.xml
- Find the "eventHandlerFactory" bean
- In the map that defines the EventHandlerTypes constructor argument, change the .xsl files listed to point to your custom .XSL files
Editing these directly changes the behavior of all of your Model-Glue applications.
Application-specific .XSL files
To change the .XSL files used by a single Model-Glue applications, copy the entire EventHandlerFactory bean from /ModelGlue/unity/config/Configuration.xml into your application's ColdSpring.xml file.
Then, follow the instructions in "Creating New .XSL Files," editing your ColdSpring.xml's EventHandlerFactory settings instead of those found in /ModelGlue/unity/config/Configuration.xml.
![(please configure the [header_logo] section in trac.ini)](/ModelGlue.com/trac.cgi/chrome/site/your_project_logo.png)