 |
Please Note:
HierMenus is protected by copyright laws. Use of the HierMenus code requires a paid licensing agreement.
|
|
 |

|
 |
 |
|
home / documentation / reference / hm_configfiles
HM_ConfigFiles
- Description:
- The name(s) of your used-defined HierMenus configuration files.
- Value:
- String, empty string (""), or JavaScript expression that returns a
String/empty string.
- Applies To:
- Globally.
- Browser Compatibility:
- HM_ConfigFiles is supported in all browsers.
- Comments:
- HM_ConfigFiles is a comma separated list of the names
of your HierMenus configuration files. The configuration file contains
the information HierMenus needs to build and display your specific menus on your
pages. You create (at least) one configuration file as part of your HierMenus setup (see
the setup instructions for further details).
Most sites will contain only a single configuration file, however, it is possible
to specify multiple configuration files if necessary. To specify multiple configuration
files, separate them with commas; i.e.
HM_ConfigFiles="config1.js,config2.js";
When specifying multiple configuration files in this manner, do not put any spaces
between the commas and the configuration files themselves.
HM_ConfigFiles is a global variable that is set in the HM_Loader.js
file. It is not set in the configuration file as other
configuration parameters are, which explains why it is set using a standard JavaScript
assignment statement (via the = sign). The reason for
this is because HierMenus needs to know the value of HM_ConfigFiles
before the configuration files themselves are loaded. See the examples below.
If HM_ConfigFiles is set to the empty string, then HM_Loader.js
will not attempt to load any configuration file. The only reason you would do this
is if you intend to provide valid HierMenus configuration directives via some custom
means, such as a server-side ASP or PHP tool. See the Advanced Options section of
the setup instructions for further details.
Note how the configuration parameter setting HM_ConfigDir interacts
with the HM_ConfigFiles parameter. HM_ConfigDir is
always added to the front of each configuration file specified
in HM_ConfigFiles to arrive at the actual server location for
each file. For example, given these two settings:
HM_ConfigFiles="config1.js,config2.js";
HM_ConfigDir="http://mydomain.com/hm/configs/";
HierMenus would attempt to retrieve these two files from the server
http://mydomain.com/hm/configs/config1.js
http://mydomain.com/hm/configs/config2.js
In the HM_Loader.js file, you may note that the default setting for
HM_ConfigFiles looks a little cryptic:
if(typeof(window.HM_ConfigFiles)=="undefined")
HM_ConfigFiles = "HM_Config.js";
Though admittedly verbose, setting the parameter in this manner (with the if...
logic on the line just prior to the setting of the actual parameter) allows you
to override this setting on a page by page basis if you should choose to do so at
a later time. i.e., The logic above basically says "if HM_ConfigFiles is not
already set, set it now." If you know that you will never be overridding HM_ConfigFiles
on any of your pages, then you can remove the if... line that precedes the
HM_ConfigFiles setting. We recommend, however, that you leave it as is so that
you can take advantage of the feature at a later time if need be.
- Examples:
// Ok:
HM_ConfigFiles = "HM_Config.js",
HM_ConfigFiles = "hmDefaults.js,hmMenus.js",
HM_ConfigFiles = "http://mydomain.com/hm/configs/menus.js",
// For above to work, HM_ConfigDir
// must be empty
HM_ConfigFiles = "", // no config file
HM_ConfigFiles = (HM_NS4)?"ns4menus.js":"menus.js",
// if browser is Netscape 4.x, use ns4menus.js
// otherwise use menus.js
// Incorrect:
HM_ConfigFiles = HM_Config.js,
// strings must be quoted
HM_ConfigFiles = " ",
// no spaces allowed in the empty string
HM_ConfigFiles : "HM_Config.js",
// must use = sign (not colon)
HM_ConfigFiles = '(HM_NS4)?"ns4menus.js":"menus.js"',
// no quoted expressions
- Default:
- ""
- See Also:
-
HM_ScriptDir,
HM_ConfigDir,
HM_ConfigType,
HM_FramesEnabled,
HM_ImageDir
|
|