I want to thank everyone for your interesting perspectives on this.
Definitely I was planning on using external js and css files for the
standard stuff, but I was also looking for the flexibility to throw in an
individual function or style on a page when they are not likely to be needed
elsewhere, so as not to bloat those external files needlessly.  Sounds to me
like the solution is to dictate such things by section rather than by page.

So, here is what I have done, for anyone who is interested:
1. In Application.cfm I test for the existence of my dsn variable and if it
is not defined I include my globals.cfm file which initializes all of my
universal variables.  Then I test to see what section of the site I'm in.
I'm using <cfset thisDirectory = GetToken(cgi.path_info, 1, "/")> which I
hope works in the long run (I only care about the top level directory), then
I loop through a 2-dim array in which the first element is the section title
and the second element is a list of the directories that I want to be
considered part of that section.  When thisDirectory is found in that list,
I set Request.SubNav equal to the value of the first element, i.e. the
navigational section in which this page belongs.  I use cfswitch to include
a different file for each section of the site, in which
cfparam is used to set a default Request.PageTitle, Request.METADescription,
and request.METAKeywords, and a section-specific css and js file name is
defined.
2.  Each page will carry
<cfset Request.PageTitle = "My Specific Page Title if I Want to Override the
Default"> (optional; I'm not using Verity because, for whatever reason, the
collections are constantly going down and the host's response is just to
restart every time I complain)
<cfinclude template="../includes/design/header.cfm"> (required; would prefer
to use mappings rather than a relative link, but when I tried on the test
site it brought down CF on my live site!)
3. header.cfm tests to see whether url.print is defined; if so, a
print-friendly header is included, otherwise defaultheader.cfm is included
(yeah, I guess I could also use a custom tag, I'm thinking about whether it
offers a significant advantage)
4.  defaultheader.cfm uses #Request.PageTitle# in the title area, plus
#Request.METAKeywords# and #Request.METADescription# where appropriate, and
includes the css and js files for this section.  nav.cfm is included, in
which I loop over my navigation based on the value of  Request.SubNav (I
have a 2-dim array containing url and link title for each sub-section's
navigation, as well as one for main level nav.  This allows me to pull up
the sub-nav for the section I'm in, and pull this section's nav to the top;
admittedly, this might be overcomplicating matters a bit when a static nav
at this point would probably be just as easy to update).  Finally, the image
containing the name of the sub-section as the heading for content is called.
5.  Lastly, OnRequestEnd.cfm has <cfinclude
template="includes/design/footer.cfm"> which tests for url.print and
delivers an appropriate footer based on this.  The advantage is that I don't
have to include a footer on each individual page; the disadvantage is that I
can't use cflocation (since it doesn't call OnRequestEnd.cfm).

[Naturally, other code snippets are also available for include, such as
<cfinclude template="../includes/design/BackToTop.cfm"> which will put a
formatted "back to top" link at the bottom of long pages; too bad there's no
way to programmatically figure the length of a page and include it
automatically!]

The only part I'm still hesitant about is the navigation.  I really do
wonder if I'm making it more complicated than it needs to be.

Thanks everyone! This was my first post and I'm impressed by the
friendliness and helpfulness of each of you.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm?link=i:4:137796
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. 
http://www.fusionauthority.com/signup.cfm

Reply via email to