Many Fusebox developers set a variable called "self" which they use in their links. In most cases, this points back to the root index.cfm file. But the nice thing about using #self# instead of a hardcoded reference is that it is simple to change the name of this file, or to make unit testing easier. This is often done in the new fusebox.init.cfm file when using Fusebox 4.1.
Along the same line, some folks are now using a variable called "mySelf" that contains not only "index.cfm" but also the fuseaction variable name. Doing this makes changing your fuseaction variable (say from "fuseaction" to "method") very easy:
If you used it like this:
You'd end up with something like this:
Well I realized that with a little more tweaking, #mySelf# could also decide whether to append an ID and token to the URL by using the URLSessionFormat() function. If you aren't aware, this function will automatically append the CFID/CFTOKEN or JSESSIONID to the URL if the user does not allow cookies. I did it like this:
<!--- Workaround for IIS problem with JSessionID: http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=1c6b723 --->
<cfif findNoCase( 'index.cfm;', mySelf )>
<cfset mySelf = replace( mySelf, 'index.cfm;', 'index.cfm?' ) />
<cfif right( mySelf, 9 ) eq "index.cfm">
<cfset mySelf = mySelf & "?" />
<cfset mySelf = mySelf & "&" />
<cfset mySelf = mySelf & "#application.fusebox.fuseactionVariable#=" />
It's a little more complex than one thinks it should be because of how the function appends the token in different situations. But that's what it took to get it to work in my tests. That said, it seems to work very nicely!