Fusebox Layouts: A New Beginning

 
Aug 04, 2004

The center cannot hold. The sturdy set structure that we have come to believe in and hold true has been overturned. We felt .. no, we were taught ... to use our circuits to build nested tables. To lay out our fusebox rigidly and tightly.

We were right. ... THEN...

But it is no longer then. It is now. And now there is a better way. A cleaner way. A way that is both simple and elegant. A way to lay out our applications with style and grace. And only one person can bring us this new knowledge.

And we must ask her ...

"Sandy, as I understand it, Fusebox 3 uses nested circuits and nested tables for its layouts. Why should we learn something new?"

Sandra Clark: Layouts have changed a lot from Fusebox 3. In Fusebox 3 the nested layout model emulated the nested table model that most people commonly used. However with the emphasis in the design community regarding web standards, CSS and tableless layouts, Fusebox 4 allows you the flexibility to set up and handle layouts however you want. We all deal with layouts; knowing how Fusebox 4 handles them is integral to using them.
 
Michael Smith: So why is CSS better than table layouts?
 
SC: Using CSS (including positioning) to style your markup is better than using table layouts for a variety of reasons. Most importantly for me is maintainability. It is much easier to code and maintain simple markup than markup that is between nested tables. Also, nested tables are bloated and take time to load on our client's browsers. Markup that is done with xHTML and CSS is commonly at least 40% smaller (sometimes more). It loads faster (remember that browsers can't display tables until the last table is closed), so it gives users a better experience. Its also much easier to change the way a page looks without changing the markup.

Layouts done via CSS will also work well on all user agents (visual browsers such as IE and Mozilla), text only browsers, and mobile phones, all without changing your markup.
 
MS: That makes sense. When you say "simple markup" do you mean HTML tags such as H1, H2, STRONG, etc.?
 
SC: Yes, the HTML elements. By using all of the selectors that CSS offers (which are more than simply classes), we can create HTML that is simple, clean and very easily maintainable as well.
 
MS: And if I still want to code table layouts, can Fusebox 4 handle that? For example, I might want to upgrade an existing Fusebox 3 site to 4...
 
SC: Fusebox 4 can still handle table layouts. However, the nested layout model does not exist in FB4 so while you can emulate it, it isn't a slam dunk to just change over. Layouts in FB4 are much more flexible and give you more choices than FB3. Upgrading an FB3 site to FB4 requires a change in the layout paradigm.
 
MS: I thought there was a plugin for nested layouts in FB4...
 
SC: I had written one for FB4 and ultimately gave it up; it wasn't a simple plug it in and have it work. Since then, I've discovered that it is best to use the prefuseaction function in the circuit, using the callsuper attribute to emulate nested layouts. But really, it's a very convoluted way of creating layouts. There are much simpler, more flexible ways of doing layouts in FB4.
 
MS: So do layouts in FB4 still use the fusebox.layout variable that FB3 used to display the dynamic content created in the fuseaction?
 
SC: No, as someone said at the last fusebox conference, "You mean the layout model in Fusebox 4 is that there is no layout model?" Layouts are totally within the programmers control, with lots of ways of achieving what you want.
 
MS: Hmmm, I thought there were custom layout variables in Fusebox 4...
 
SC: Yes, Fusebox 4 utilizes content variables in the circuit. FB4 uses it in the DO command and (I hear, but have not confirmed) that FB4.1 adds it to the INCLUDE command as well. What a content variable does is take any output from a fuse (or a file in the case of an INCLUDE) and stuff it into a variable. These variables can then be used in various ways, including layouts. You determine what gets put in which variable and where those variables are ultimately used.
 
MS: That sounds really powerful! I can't wait to see you talk.
 
You can see more interviews at http://www.cfconf.org/Fusebox2004/news.cfm and right here in Fusion Authority. The Fusebox Conference is Saturday 9/18/04 - Sunday 9/19/04 in the Washington DC area. It costs $199. For more information on the Fusebox Conference, see http://www.cfconf.org/Fusebox2004/.
Sandra Clark, an advanced Macromedia Certified ColdFusion developer, is a Senior Software Developer with the Constella Group in Bethesda, Maryland.

She has contributed material to the ColdFusion 5.0 Certified Developer Study Guide published by Syngress Media/Osborne McGraw Hill and to the ColdFusion Developers Journal. She has also spoken at various CFUGS and ColdFusion User Conferences around the country. Sandra is an active proponent of applying accepted and proven web standards to development as a way of improving accessibility as well as making life easier on developers.

# Posted By laptop battery | 29-Oct-08 08:50 PM
Add a Comment
(If you subscribe, any new posts to this thread will be sent to your email address.)
  
Privacy | FAQ | Site Map | About | Guidelines | Contact | Advertising | What is ColdFusion?
House of Fusion | ColdFusion Jobs | Blog of Fusion | AHP Hosting