tree menu eMenuTree: Inserting multiple links


I. Introduction

There are three ways to automatically insert multiple links into your tree menus .  The Build tree menu has a "Insert multiple nodes" command, and every page node has an "Insert multiple links into tree menus " option.  The "Insert multiple links into tree menus " option normally inserts these links when you run the program.  But you may also choose to insert these using ASP server side scripting.

All three of these allow you to automatically insert links to all files in a folder on your hard disk, and all three allow you to select which files to link to.  The difference is when the links are inserted: at build time, at run time, or by the server using ASP server side scripting.

II. Build tree menu "Insert multiple nodes" command

The "Insert multiple nodes" of the Build tree menu actually inserts all the nodes into your project.  They will appear in the tree which you see in the Build tree screen in eMenuTree.  You can then modify these nodes as you please.

III. "Insert multiple links into tree menus " page link options (non-ASP)

To select this option you insert a page node into your tree menu in build view, select the "Insert multiple links into tree menus " option, and then click the select folder button.  A form will appear that allows you to select the folder you want to insert into your tree menus and various options.

A page node with the option "Insert multiple links into tree menus " is a place-holder for the links to the files in the folder you selected.  The links are not inserted into the build-tree screen, they are directly inserted into you tree menu(s) when you run the program.  The advantages of this are (a) projects will load and save more quickly, and (b) when you modify the files on you hard disk, all you need to do is re-run the program.  The updated project will have links to the modified files.

IV. "Insert multiple links into tree menus " page link options (using ASP)

This is the most powerful of the three options.  You choose this option selecting "Insert multiple links into tree menus " page link option and then checking "Use ASP server side scripting" option on the select folder form.  When your run the program an ASP function is inserted into your tree menu(s).  (No links are inserted at either build time or run time, just this ASP function.)  When a browser requests your page from the server, this ASP function examines the hard disk on the server and sends a tree menu with links to the files in the selected folder.  The advantage of this is that when you add new files to the server, the ASP function realizes this and automatically includes links to these files the next time a browser requests a page with your tree menu in it.  You don't need to update your tree menus every time you add files to the server.

What is the relationship between the ASP function and eMenuTree's DHTML (javascript) tree menus ?  The ASP function sends to the browser the standard eMenuTree javascript tree menu code.  That is, this ASP function writes an eMenuTree javascript tree menu.  The browser receives the same code as it would if you had inserted the links at run time rather than using ASP server side scripting.  As always, when a user clicks on a folder in any major browser, it is this javascript that opens and closes folders.  (The point: unlike some other ASP tree menu programs, the user does not need to return to the server to open and close folders.)

Please note the following:

1. You must choose the "Use ASP files and server side include" option. eMenuTree will write the tree menu to the file emenu.asp, *not* emenu.js.  The menu must be inserted into pages with server side include (see eMenuTree's internal editor for the exact code).  All files with tree menus must have the extension .asp.

2. You must be using a server that supports Microsoft's Active Server Pages (ASP).  (The server must be using Mircosoft software, but as with all tree menu pages the user *doesn't* need to be using a Microsoft browser or Microsoft operating system.)

3. The relative path from your project folder to the folder whose files you want to link to must be the same on the server as it is on your computer.  The project folder itself can have a different name on the server along with its parent folders, but any subfolders which are named in the relative path must exist on the server.  That is, if the relative path from the project folder to the folder whose files you want to insert is "..\examples", then there must be an "examples" subfolder to the parent folder of the project folder on the server.

4. To preview the tree menu(s) on your computer, you must have a server on your computer that runs ASP (such as Mircosoft's personal web server which ships with Windows 98 and above).  You must also enter the URL as the URL to preview, an option of the Frameset tab.

V. Selecting files when inserting multiple nodes

In all three methods of inserting multiple files, you select the folder, the files to include and exclude, whether to include files in sub-folders, whether to include the sub-folder structure, and whether to open pages in a new window, the same window,or the right frame.  Note:

1. The folder must be in your web root folder or you must choose the option "Link directly to hard disk drive".

2. In the files to include and exclude boxes, include one entry per line.  The entries are *not* case sensitive.

3. The files to include option is meant to be the extensions to include, but the real rule is simply that the file name must end in one of the strings listed in the text box.

There are six options that affect the link line name.  You can include the file size, the date last modified, the time last modified, and the file extension.  The last two options let you select the name more precisely.  They are defined as follows:

1. Replace underscore with space -- the underscore is replaced with a space, a double underscore is replaced with a single underscore

2. Sentence capitalization -- converts a name such as "seeAboveExample" to "See above example".  The actual rules this option applies are:

a. Do nothing if the file name contains an underscore.

b. Capitalize the first letter of the file name.

c. If an uppercase letter is preceded by a lowercase letter, change it to lowercase and insert a space before it.

Checking both of these last two options gives the following results:
File name Link name Comment
seeAbove See above Applies sentence capitalization
See_Above See Above Replace underscore with a space; Sentence capitalization is not applied because of the underscore.
buyIBM Buy iBM Applies sentence capitalization.
Buy_IBM Buy IBM Sentence capitalization not applied because of underscore.
John__Doe John_Doe Replace double underscore with single underscore.

VI. Addendum

When you select a folder to insert, the program does not insert the folder itself, it inserts the subfolders and files in that folder into your tree.  If you want to insert the folder as well, do this manually by first using the insert folder command, give this new folder the name you want, and then insert subfolders and files into this folder.