The techniques

Java Applets

Java Scripts

Style Sheets

DHTML tags

ColdFusion tags

Download


When you want to leave foreign sites, press Reset at bottom to launch Assists

[TOP]
Variable Image
Popups by overLIB
Assists - Tips 'n Tricks
Assists - Tips 'n Tricks

 CF TAGS 

- (CF Studio version 5.0 / CF 5.0 Server)



I've been peeling in the surface for some time, and as a start there are a few things that will ease your life. Here  we go :

Including text-files with cfm-attribute


As long as you are storing all files in the same pot your life is trivial, but sooner or later you loose control. Alternatively create separate folders for different topics or genders (one for scripts, one for images etc).
I know that this will ruin your mapping. Will talk about independent mapping later. Running your application from local host you soon realize that there are differences in behaviour from the ISP host. It doesn't matter if you have an identical mapping. Some tags don't work unless...

Rule 1


As long as you are including cfm-files from a folder, the folder has to be defined on the same level as the www-entry on your WEB-host.
On your local host you may define the folder directly under the wwwroot-level.

--- <CFINCLUDE template="../NEWS/any_file.cfm"> ---

The tag works whenever you are running you application locally or from your ISP host.

Common block area


What is common block area ? Multifunction systems have one way to share infomation through defined "common block" area which was resident according to systems' lifecyclus. Within the common area all params etc. were defined and given specific values and could be accessed from any shared system.

Coldfusion has another method, by declaring a quite anonymous systemfile which may contain similar params. When invoking a site Coldfusion is looking for the systemfile to see what params are valid. If empty or missing Coldfusion ignores the search.

Rule 2


Declare an empty file named

--- application.cfm ---

The file have to reside directly under wwwroot on your local host and under www on your WEB-host.

Pseudodynamic mapping


Once set up the folder-/file hierarchy I think everybody believes it lasts forever.
How to make day-to-day maintenance more trivial...

We have defined application.cfm, and I think the systemfile can help us. Secondly there are a few CF commands we have to use. Here is a typical example :

<CFIF CGI.REMOTE_HOST NEQ "127.0.0.1">  <!--- Application on WEB server --->
  <!--- Mapping for global navigation. --->
  <cfset request.application.webroot = "http://#CGI.HTTP_HOST#">
  <!--- Mapping for ccs-folder --->
  <cfset request.css.root =  "http://"&#CGI.HTTP_HOST#&"/"&"css/">
<CFELSE>  <!--- Application on local server --->
  <!--- Mapping for global navigation. --->
  <cfset request.application.webroot = "http://#CGI.REMOTE_HOST#/">
  <!--- Mapping for ccs-folder --->
  <cfset request.css.root =  "http://"&#CGI.REMOTE_HOST#&"/css/">
</CFIF>

We have now defined that the application is residing at root level on the WEB-host and at IP-address 127.0.0.1 level (root) on local host. The path to css-folder tells that the folder is defined under the root.

How to use this information ?
Including style01.css  from the css-folder in your site, the tag goes like this :

--- <CFOUTPUT><link href="#request.css.root#style01.css" rel="stylesheet" type="text/css"></CFOUTPUT> ---

The path is --- #request.css.root#.
If you want to rename the folder or change the hierarchy, you only have to perform changes one place; the definitions in application.cfm.


Stay tuned
EriX