Well thanks Adam,

Would you mind sending me your applayout.cfm file together with an index.cfm
file?
I am a little bit confused....thinking about the index.cfm file!!

I'll have a look at the <CFSaveContent> tag in the meantime.

Thanks again,
Sneid



-----Original Message-----
From: Adam Phillip Churvis [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 23, 2001 10:57 AM
To: Fusebox
Subject: Re: Cf_BodyContent and other functionalities!!


> I've been using Cf_bodyContent for a little while but my question is:
>
> What are the other functionalities of this tag apart from the fact that it
> enables us to insert a header and a footer?
>
> I've been missing a great deal of things...what are the other possiblities
> that exist????

You can easily define context-dependent sections for a website.  For
instance, say you have both customer-facing and admin-facing sides of your
Extended Fusebox website, each of which has its own navigation bar
containing applicable links on the left side of the browser.  You want to
create a single layout template rather than separate layout templates for
the customer-facing and admin-facing sides of the site.

How do you do this?

Inside appLayout.cfm, create the set of links for your Customer-facing
content, and define this set of links as a CF_BodyContent object named
"NavBar".  Now wrap it with an IsDefined test for NavBar, like so:

<cfif NOT IsDefined('Request.NavBar')>
 <cf_bodycontent name="NavBar">
 <a href="#Self#?fa=home.home">Current Meeting</a><BR>
 <a href="#Self#?fa=login.newuserform">Sign Up!</a><BR>
 <a href="#Self#?fa=login.edituserform">My Profile</a><BR>
    ...
 </cf_bodycontent>
</cfif>

A little farther down in appLayout.cfm, you display NavBar wherever you want
it by simply outputting #Request.NavBar#.

So far, so good.  If a NavBar object isn't already defined when we come to
appLayout.cfm (which is the very last thing that happens on each page
display), the Customer-facing (default) NavBar is displayed.

Now go to the fusebox for the admin-facing side of the website, and just
before the CFSWITCH statement, place a definition for the NavBar you want to
use for the admin functions.  But this time, don't do any kind of test
first:

<cf_bodycontent name="NavBar">
<a href="#Self#?fa=admin.rsvpreport">RSVP Report</a><BR>
<a href="#Self#?fa=admin.sendannouncementform">Send Announcements</a><BR>
   ...
</cf_bodycontent>

So what happens?

Each page request ends with appLayout.cfm getting CFINCLUDEd at the end of
the main fusebox.  If you're browsing in the admin-facing side of the
website, then admin's definition of NavBar will already exist before
appLayout is called, so _that_ NavBar will be displayed in appLayout.cfm.
If you're browsing in the customer-facing side of the site, or if you're
browsing in a nested fusebox that doesn't have its own definition for
NavBar, then the customer-facing (default) NavBar will be displayed, because
no NavBar object exists upon entering appLayout.cfm.

Pretty cool, huh?

In ColdFusion 5 there is a native tag named <CFSaveContent> for doing
exactly the same thing.

By the way guys, I just joined the Fusebox list and this is my first post.
I look forward to conversing with all of you!

Respectfully,

Adam Phillip Churvis
Productivity Enhancement, Inc.

Want truly advanced ColdFusion 5 training?  Register for the Advanced
Bootcamp for ColdFusion 5, Database, and Javascript at
http://www.ColdFusionTraining.com!

http://www.CommerceBlocks.com

E-mail:  [EMAIL PROTECTED]
Phone:   770-446-8866
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to