Using cfswith to specify different circuits

I use the following code to use specific imagery or code on different sections of the website.

<cfswitch expression=”#UCase(myFusebox.OriginalCircuit)#”>
<cfcase value=”CIRCUIT NAME 1″>
</cfcase>
<cfcase value=”CIRCUIT NAME 2″>
</cfcase>
<cfdefaultcase>If neither circuit 1 or 2</cfdefaultcase>
</cfswitch>

If you need to target more than one circuit then separate them with a comma.

<cfcase value=”CIRCUIT NAME 1, CIRCUIT NAME 2, CIRCUIT NAME 3″>

Another method that works really well is:

<cfif ListFindNoCase(“home”, myFusebox.originalcircuit) neq 0>
Display this text on the home page circuit
<cfelse>
otherwise display this on every other page
</cfif>

This entry was posted in coldfusion. Bookmark the permalink.

2 Responses to Using cfswith to specify different circuits

  1. Will match the home, about and/or foobar circuit

  2. <cfif ListFindNoCase(‘home,about,foobar’, myFusebox.originalcircuit) neq 0>

    </cfif>

    Will match the home, about and/or foobar circuit

Leave a Reply

Your email address will not be published. Required fields are marked *

*


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>