Customize your app_layout.cfm and/or use something simular to an
app_model.cfm. Hmmm, hell why not, some examples.
Here's a simple shell that's using the customized app_layout.cfm.  You'll
see how you'd add things to the sidebar from anywhere by using array inserts
as shown in the app_locals.cfm.


Application.cfm
----------------
<!--- We don't want our patrons being tooo nosey.--->
<cfif findnocase("cfm",cgi.cf_template_path) and not
findnocase("index.cfm",cgi.cf_template_path)>
 <cflocation url="index.cfm?badfile=yes">
</cfif>

<!--- If its not me throwing an error I want to know about it --->
<cfif not find("0.0.0.0", cgi.remote_host)>
 <cfif cgi.cf_template_path is not "error.cfm">
  <cferror type="exception" template="error.cfm">
 </cfif>
</cfif>

<!--- Get our application's model and initialize those variables. --->
<cfinclude template="app_model.cfm">

<!--- Override settings in app_model.cfm with this server's specific
settings. --->
<cfinclude template="app_server.cfm">

<!--- Security: Check to see if we are being run in another site's
frame. --->
<cfif not find("#request.site.IP#", cgi.remote_host)>
 <cflocation url="#request.site.webroot#/index.cfm" addtoken="NO">
</cfif>


app_model.cfm
----------------
<cfsetting enablecfoutputonly="yes">

<CFSCRIPT>
 // Initialize Site Variables
 request.site = StructNew();
 request.site.Name  = "";
 request.site.Owner   = "";
 request.site.Email   = "";
 request.site.Protocol  = "";
 request.site.IP   = "";
 request.site.URL   = "";
 request.site.CFRoot   = "";
 request.site.CFPath   = "";
 request.site.ModRoot = "";
 request.site.ModPath = "";
 request.site.SSLRoot  = "";
 request.site.SSLPath  = "";
 request.site.WebRoot  = "";
 request.site.imgRoot  = "";
 request.site.imgPath  = "";
 request.site.TimeSpan = "";
 request.site.TimeOut  = "";
 request.site.TestMode = "";
 request.site.section = "";
 request.site.subsection = "";
 request.site.mappedtags = false;

 // Initialize Datasource Variables
 request.DSN  = StructNew();
 request.DSN.Main  = "";

 // Initialize Page Variables
 request.page = StructNew();
 request.page.display  = true;
 request.page.headers = ArrayNew(1);
 request.page.leftsidebar = ArrayNew(1);
 request.page.rightsidebar = ArrayNew(1);
 request.page.footers = ArrayNew(1);
 request.page.nocache = "true";
 request.page.HTML = "";
 request.page.head = "";
 request.page.title    = "";
 request.page.description = "";
 request.page.abstract   = "";
 request.page.keywords   = "";
 request.page.author   = "";

 request.page.js = StructNew();
 request.page.js.scriptfiles = ArrayNew(1);
 request.page.js.onLoad = ArrayNew(1);
 request.page.js.onunLoad = ArrayNew(1);
 request.page.js.alerts = ArrayNew(1);

 request.page.cssFiles = ArrayNew(1);
 request.page.nocache = "true";

 request.page.body = StructNew();
 request.page.body.bgcolor  = "";
 request.page.body.fontcolor  = "";
 request.page.body.linkcolor  = "";
 request.page.body.vlinkcolor = "";
 request.page.body.alinkcolor = "";

 // Initialize User Variables
 request.user = StructNew();
  request.user.ID ="";
  request.user.login ="";
  request.user.Company = "";
  request.user.email = "";
  request.user.isValidated = "0";
</CFSCRIPT>
<cfsetting enablecfoutputonly="no">

app_server.cfm
------------------
<cfif not cgi.server_port is 443>
 <cfset request.site.protocol = "http://">
<cfelse>
 <cfset request.site.protocol = "https://">
</cfif>

<cfscript>
 request.site.ip   = "0.0.0.0";
 request.site.url   = www.whatever.com;
 request.site.cfroot   = "/fred";
 request.site.webroot  =
"#request.site.protocol##request.site.url##request.site.CFroot#";
 request.site.cfpath   = "c:\inetpub\wwwroot\";
 request.site.modroot = "#request.site.cfroot#/customtags";
 request.site.modpath = "#request.site.cfpath#\customtags";
 request.site.sslroot  = "";
 request.site.sslpath  = "";
 request.site.imgroot  = "#request.site.webroot#/images";
 request.site.imgpath  = "#request.site.cfpath#\images";

 request.DSN.Main  = "eStore";
</cfscript>

app_globals.cfm
-------------------

<!--- Check to see if our application has already been initialized. Fire
cfapplication if it hasn't. --->
<cfif NOT isDefined('application.applicationname')>
 <cfapplication name="eStore" sessionmanagement="No" clientmanagement="Yes"
setclientcookies="Yes" applicationtimeout="#createtimespan(2,0,0,0)#">
</cfif>

<!--- Check to see if the user has logged in. --->
<cfif isDefined('client.UserID')>
 <cfset request.User.ID = client.UserID>
 <cfset request.User.isvalidated = 1>
</cfif>

<!--- Check to see if we have to run any of our global queries --->
<CFINCLUDE TEMPLATE="#request.site.cfroot#/qry_Application.cfm">

<!--- to keep from having to do constant readonly locks on application
scoped variables --->
<cflock scope="APPLICATION" type="READONLY"
timeout="#createtimespan(0,0,2,0)#">
 <cfset request.app = duplicate(application)>
</cflock>

app_locals.cfm
----------------

<!--- Pull global settings --->
<cfinclude template="#request.site.cfroot#/app_globals.cfm">

<!--- Part of the Fusebox Spec. Makes copies of all form. and url. values to
the attributes. scope --->
<cfif not isDefined('attributes.fuseaction')>
 <cfmodule template="#request.site.modroot#/formurl2attributes.cfm">
</cfif>

<CFSCRIPT>
 // Initial Page Layout Settings
 request.page.body.leftmargin = 0;
 request.page.body.topmargin = 0;

 // Add Beginning Display Templates.
ArrayAppend(request.page.headers, "/dsp_header.cfm");
ArrayPrepend(request.page.footers, "/dsp_footer.cfm");

// Add Beginning Left Sidebar Widgets
ArrayAppend(request.page.leftsidebar, "/dsp_searchform.cfm");
ArrayAppend(request.page.leftsidebar, "/catalog/blocks/dsp_browsebox.cfm");

// If We're using them add Right Sidebar Widgets
//ArrayAppend(request.page.rightsidebar, "/dsp_searchform.cfm");

 // Current Section
 request.site.section = "Home";
</CFSCRIPT>

index.cfm
------------
<cfinclude template="#request.site.cfroot#/app_locals.cfm">

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

<cf_stripwhitespace mode="literate">
 <cf_bodycontent>
  <cfswitch expression="#attributes.fuseaction#">
   <cfcase value="home">
    <cfinclude template="#request.site.cfroot#/dsp_default.cfm">
   </cfcase>
   <cfdefaultcase>
    <cfthrow type= "Invalid_Fuseaction"
     message ="We are sorry. That is not a valid Fuseaction."
     detail = "An invalid Fuseaction has been called.">
   </cfdefaultcase>
  </cfswitch>
 </cf_bodycontent>
</cf_stripwhitespace>

app_layout.cfm
-----------------
<!--- For compatibility with cf_bodycontent --->
<cfset request.page.html = request.bodycontent>
<cfoutput>
<html>
<head>
 <title>#request.page.title#</title>
 <meta http-equiv=content-type content="text/html; charset=iso-8859-1">
 <cfif arraylen(request.page.cssfiles)>
  <cfloop from="1" to="#arrayLen(request.page.cssfiles)#" index="i">
   <link rel="stylesheet" href="#request.page.cssfiles[i]#" type="text/css">
  </cfloop>
 </cfif>
 <!--- This keeps our urltoken from showing up in urls usage:
onClick="addtoken(this)" --->
 <script language="JavaScript">
  <!--
  function addtoken(what) {
   what.href += '&#client.urltoken#';
  }
  //-->
 </script>

 <cfif arraylen(request.page.js.scriptfiles)>
  <cfloop from="1" to="#arrayLen(request.page.js.scriptfiles)#" index="i">
   <script language="JavaScript"
src="#request.page.js.scriptfiles[i]#"></script>
  </cfloop>
 </cfif>
 #request.page.head#
 <cfif request.page.nocache>
  <cfheader name="EXPIRES" value="NOW()">
   <cfset gmt = gettimezoneinfo()><cfset gmt = gmt.utchouroffset>
   <cfif gmt eq 0>
    <cfset gmt = "">
   <cfelseif gmt gt 0>
    <cfset gmt = "+" & gmt>
   </cfif>
  <cfheader name="Pragma" value="no-cache">
  <cfheader name="Cache-Control" value="no-cache, must-revalidate">
  <cfheader name="Last-Modified" value="#dateformat(now(), 'ddd, dd mmm
yyyy')# timeformat(now(), 'HH:mm:ss') GMT#gmt#">
  <cfheader name="Expires" value="Mon, 26 Jul 1997 05:00:00 GMT">
 </cfif>
</head>
<body<cfloop collection="#request.page.body#" item="attr">
#attr#="#request.page.body[attr]#"</cfloop> onload="<cfloop from="1"
to="#arrayLen(request.page.js.onload)#"
index="i">#request.page.js.onload[i]#;</cfloop>">
<cfloop index="i" from="1" to="#arraylen(request.page.headers)#">
 <cfinclude template="#request.site.cfroot##request.page.headers[i]#">
</cfloop>
<br clear="all">
<table align="left" border="0" cellspacing="2" cellpadding="2">
 <tr>
  <td width="171" valign="top">
  <cfloop index="i" from="1" to="#arraylen(request.page.leftsidebar)#">
   <cfinclude template="#request.site.cfroot##request.page.leftsidebar[i]#">
   <br>
  </cfloop>
  </td>
 </tr>
</table>

<table align="right" border="0" cellspacing="0" cellpadding="0">
 <tr>
  <td width="171" valign="top">
  <cfloop index="i" from="1" to="#arraylen(request.page.rightsidebar)#">
   <cfinclude
template="#request.site.cfroot##request.page.rightsidebar[i]#">
   <br>
  </cfloop>
  </td>
 </tr>
</table>
<table align="center" border="0" cellspacing="0" cellpadding="2">
<tr><td valign="top">#request.page.html#</td></tr>
</table>
<br clear="all">
<cfloop index="i" from="1" to="#arraylen(request.page.footers)#">
 <cfinclude template="#request.site.cfroot##request.page.footers[i]#">
</cfloop>
</body>
</html>
</cfoutput>

OnRequestEnd.cfm
-----------------------
<cfif request.page.display>
 <cfinclude template="app_layout.cfm">
</cfif>


----- Original Message -----
From: "K. Bennani" <[EMAIL PROTECTED]>
To: "Fusebox" <[EMAIL PROTECTED]>
Sent: Monday, January 08, 2001 11:37 AM
Subject: Left navigation and CF_BodyContent


> Hi,
>
> What is the best way to implement a left navigation bar (like the one you
can see on www.amazon.com) with CF_BodyContent without using frames?
>
> Best regards,
> Kamal
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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