This is something that everyone does differently, and - to a great extent - most are 
valid ways of doing it. In other words, there IS NO "RIGHT" WAY to do this.

That said, here are some of my preferences and suggestions:

1) Yes, as others have said, by all means put the CSS and JavaScript into .css and .js 
files, for many good reason (caching, single file, reduce page code clutter)

2) Unless there is a compelling reason to do so (and I've seen few in well-designed 
apps), have only one application.cfm file. Simple is better.

3) My preference is to use the following (greatly simplified) method of building pages:
<cfinclude template="header.cfm">
<!--- BEGIN ACTUAL PAGE --->

(Here, either pull in an include base on URL param or whatever, or hard coded)

<!--- END ACTUAL PAGE --->
<cfinclude template="footer.cfm">

The header and footers contain all the open/close HTML/BODY etc tags; the header also 
pulls in the CSS and JS scripts.

Note that the header can be a large file with a lot of logic - for example, if the 
user is in the admin section of a site, it will pull in "admin.css" instead of the 
site's regular css file, "regular.css" and so on. 

It can also pull in other CFM includes (such as menus and submenus) based upon where 
the user is.

------

Again, this is a HIGHLY over-simplified version of what you can do, but it might help 
give you some ideas of a way to go.
>We all know that cfinclude is perfect for design headers and footers, but
>now that I'm actually redesigning my site to take advantage of this, I'm
>running into some perplexing problems.  (Please don't suggest FuseBox,
>that's way overkill for this site and I don't have the time for it).
>
>My initial thought was: set up an Application.cfm and OnRequestEnd.cfm in
>each major section, which would call a header/footer for that section.  I
>would be able to pass a url variable to request a print-friendly version
>instead, or to request no display at all (for action only templates).
>Global variables would be cfparam'ed, and one page title and set of meta
>tags would be defined per section.  Voila, new pages can be content-only
>without even a cfinclude line---everything would be called by the section's
>Application.cfm.
>
>As I'm getting into this, I'm finding that I don't like the loss of
>page-specific flexibility.  I'm told that dynamically generated meta tags
>often are missed by search engines, for example, and I don't have a way to
>override the standard section page title for pages that really ought to have
>their own title.  I'm also stuck with defining all CSS and JS in one long
>file, even if some style definitions and JS functions are only needed on one
>page, because I've made the header of my document standardized.  Seems to me
>I'm adding all kinds of unnecessary download time.  Plus, my "section
>specific Application.cfm" idea kind of forces me to model my directories
>after my site navigation, when I'd actually prefer to avoid a lot of third
>level directories and keep pages logically grouped instead (after all,
>navigation sometimes changes over time anyway, but who wants to move
>directories around).
>
>I think I need a balance between letting CF templates "do it all" for me,
>and the tedious work of writing in each page information that is probably
>the same 80% of the time in a given section.
>
>Can anyone suggest a "best practices" approach to using cfinclude for design
>elements?  Should I hard code in most of the head area of documents, so I
>can put in page-level titles, meta tags, and page-specific styles &
>JavaScript, followed by a cfinclude containing the remainder of the head
>with links to the master style sheet, and any design code that will not
>change, followed by another include for section-specific design images?  Any
>suggestions are appreciated!
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm?link=i:4:137695
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

Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. 
http://www.fusionauthority.com/ads.cfm

Reply via email to