Server Time:
Sunday May 11 2008 08:14 PM  
Your Time:
  
HostMySite.Com is sponsoring this tutorial, please visit their site today!
This tutorial is sponsored by HostMySite.Com - ColdFusion Hosting

A brief demonstration of Fusebox 2.0
by: Pablo Varando
Email this tutorial to a friend Display Printer Friendly Format
[Download in PDF Format] [Download in FlashPaper Format]

Well, first off you might be asking yourself... what is Fusebox Methodology?

Fusebox methodology is a way of creating your web site in ColdFusion (and other languages). Basically it is a way to simplify your life and to keep things much more organized. This tutorial will demonstrate a simple use of "Fusebox 2.0". Since this tutorial version 3.0 was released which is much more complicated and requires much more knowledge of it's usage. For more information visit http://www.fusebox.org

This tutorial will use the following tags, and hopefully you are familiar with them. If you are not, please familiarize yourself with those tags before completing his tutorial. The tags are:

  • <cfswitch>
  • <cfcase>
  • <cfinclude>

I will begin by creating the index page that will use these tags. The index page will contain the following text.

<!--- Index.cfm Page --->
<!--- Define the default value of "fuseaction" as home --->

<cfparam name="fuseaction" default="home">

<!--- Now create the fusebox application --->
<cfswitch expression="#fuseaction#">
      <cfcase value="home">
            <cfinclude template=
"inc_home.cfm">
      </cfcase>
      <cfcase value=
"about">
            <cfinclude template=
"inc_about.cfm">
      </cfcase>
      <cfcase value=
"contact">
            <cfinclude template=
"inc_contact.cfm">
      </cfcase>
</cfswitch>

Ok, what does all that do you ask? Let me explain. With Fusebox you will simply call one page in your browser (in your links) at all times and that page is "index.cfm". The only thing that will change will be the fusebox variable value (in blue below).

Let me show you the possible URL for this application so you can see what I mean.

  • http://ww.mysite.com/index.cfm?fuseaction=home
  • http://ww.mysite.com/index.cfm?fuseaction=about
  • http://ww.mysite.com/index.cfm?fuseaction=contact

Now, when you pass the different fuseaction values. It basically displays the correct page, because the <cfcase> will include the required file for that fuse. Now you may be asking yourself, why would I want to do this? Wouldn't it just be easier to call the pages directly and save time? Well, the answer is no!

Fusebox allows you to do many things, one of which is to keep the user in an application structure. You could add the following value on the page: (right before the <cfswitch> tag)

<cfif #SCRIPT_NAME# neq "/index.cfm">
    <!--- let user know they've access an incorrect area of the site --->
    <script>
        alert("We're sorry, you have somehow wondered out of the site struture, taking you back into it now!");
        self.location="/index.cfm";
    </script>
</cfif>

That code will basically make sure that people access only what you want them to access. Yet another ay to make your site more secure!

The other advantages of Fusebox is that it provides you with a way to keep your application organized. If you will have a members only section, you can do this withing the <cfswitch> tags.

<!--- Make sure users are logged in to access this areas --->
   <cfif IsDefined("session.isadmin") and session.isadmin eq TRUE>
      <cfcase value="admin">
            <cfinclude template=
"inc_admin.cfm">
      </cfcase>
      <cfcase value="editor">
            <cfinclude template=
"inc_editor.cfm">
      </cfcase>
   <cfelse>
    <script>
        alert("We're sorry, You need to be an administrator to access these areas!");
        self.location="/index.cfm";
    </script>
   </cfif>

In closing, Fusebox is very powerful and very scalable. This was a brief demonstration of it's usage, there are hundreds of ways to use fusebox and you can learn much more simply by going to: http://www.fusebox.org

Questions? Comments? Email me.... webmaster@easycfm.com

 


Date added: Fri. September 6, 2002
Posted by: Pablo Varando | Views: 19296 | Tested Platforms: CF5 | Difficulty: Intermediate
Categories Listed: Methodologies

HostMySite.Com is sponsoring this tutorial, please visit their site today!
This tutorial is sponsored by HostMySite.Com - ColdFusion Hosting

This author's other tutorials:
Delete files and folders in a specified path!
This tutorial will demonstrate how you can delete all files and sub-folders in a specified folder using ColdFusion and Windows! - Date added: Wed. September 7, 2005
Dynamic Last Date Modified?
This tutorial will demonstrate how to display the date a web page was last modified to your visitors dynamically. - Date added: Mon. April 12, 2004
Correct Content (document) serving!
This tutorial will demonstrate how to correctly serve documents via ColdFusion and allow you to correctly name the download as you see fit! - Date added: Tue. February 10, 2004
Creating your very own RSS XML Feeds with ColdFusion MX!
Have you ever wanted to create your very own RSS XML News Feeds? This tutorial will show you how to create an RSS feed that will allow you to syndicate your web site and allow the world to easily use your data! - Date added: Thu. January 15, 2004
Processing XML/RSS feeds with ColdFusion MX
This tutorial will show you how to parse XML files (RSS Feeds) with ColdFusion MX and it uses an EasyCFM.COM Feed for example [Feed: 5 Most Viewed Tutorials]. It shows you how to call it via CFHTTP all the way to parse and display your records! - Date added: Sat. December 27, 2003

Additional Tutorials:
· Changing the form submission page on the fly!

· What is the ID for the record I just inserted?

· Creating a file content crawler with ColdFusion....

· Delete Records From Your Database With ColdFusion!

· Do you want to remember your members?

· Get A Folder Size Using ColdFusion and FSO...

· Preventing People From Leeching Your Images!

· Combining two queries into one..

· CaSe SensitiVe password logins!

· Creating an ODBC Connection within ColdFusion MX Server...

· Print your web pages on the fly!

· Using <CFPOP> and creating an email client for POP3 Email Reading!

· Using CFRegistry to Add Your IP To CF Debug IP List!

· Reading your IIS Log Files with ColdFusion!

· Automatically Adding Smiles To Your Messages!

· Using Arrays in ColdFusion To Properly Display Data....

· Implementing FORM Error Checking On Your Pages!

· Inserting FORM data into multiple database tables!

· Creating, Altering and Deleting database tables with ColdFusion.

· Sending multiple attachments with CFMAIL!

· ColdFusion and .INI Files!

· Clearing your session variables!

· Using PayPal's IPN with ColdFusion!

· Alternating Row Colors!

· Previous / Next n Records

· Using Query String Values....

· A quick intro into the world of Custom Tags!

· Creating a Newsletter System....

· Count Active Users On Your Site.

· User Defined Functions....

· Creating a user athentication (Login) area.

· DSNLess Coldfusion?

· A Simple Contact Us Page….

· Having Your Database Do The Work… not ColdFusion!

· Retrieving Records From a Database..

· Inserting data into a database
Please rate this tutorial:
5 Stars 4 Stars 3 Stars 2 Stars 1 Stars
Comments on this tutorial
Read previous comments on this particular tutorial
save msword file to msaccess
can anyone help me how to save an msword file to msword, and can i search an specific string onto them after i had saved them on an msaccess cell?
please help..!

kapitannwel@gmail.com
Posted by: Nhoel
Posted on: 03/05/2007 09:45 PM
Post a new comment on this tutorial
post a new comment on this particular tutorial
Your Name:
Your Email:
Comment Title:
Comments:
Key Phrase:
 
Skyscrapper Banner Advertisement
ProWorkFlow.Com

You are 1 of 710 active sessions! | Privacy | Company
Copyright © 2002 EasyCFM.Com, LLC. (Easy ColdFusion Tutorials) All Rights Reserved
All other trademarks and copyrights are the property of their respective holders.
ColdFusion Hosting ColdFusion Hosting
ADD TO:
Blink
Del.icio.us
Digg
Furl
Google
Simpy
Spurl
Y! MyWeb