Remove circuit.xml.cfm from Model and View circuits
June 25, 2008
I recently did a talk on Fusebox 5.5 at Devon CFUG and mentioned that you get rid of all those pesky circuit.xml.cfm files from the Model and View directories, and found that it isn't widely known that you can do this. For those of you who don't know this, Fusebox 5.1 had an undocumented feature which is now official in 5.5 where you can supress the need for xml files to be placed in every directory with scripts in.
Firstly let's look at how it used to be done with the "do" verb:
<!-- controller circuit.xml.cfm --> <circuit access="public"> <fuseaction name="List"> <do action="vTestimonials.List" contentvariable="content.main" /> </fuseaction> </circuit>
Then in your View folder you'd have this.
<!-- view circuit.xml.cfm -->
<circuit access="internal">
<fuseaction name="List">
<include template="dspList.cfm" />
</fuseaction>
</circuit>
This meant having to create lots of XML files which could be time consuming and didn't really do anything. Now we can use the "include" verb instead and delete the circuit.xml.cfm file from our View (and Model) circuits.
<!-- controller circuit.xml.cfm --> <circuit access="public"> <fuseaction name="List"> <set name="Request.BreadCrumb" value="Testimonials" /> <include circuit="vTestimonials" template="dspList" contentvariable="content.main" /> </fuseaction> </circuit>
You also need to add a new entry to the parameters section of your fusebox.xml.cfm config file.
<parameter name="allowImplicitCircuits" value="true" />
That's it. What a time saver!
Don't forget to reload Fusebox to get it to pick up the new parameter.
2 comments
Leave a comment
If you found this post useful, interesting or just plain wrong, let me know - I like feedback :)

Thanks,
Akbar
Comment by Akbar – June 25, 2008
Comment by John Whish – June 26, 2008