EverWeb Codebox

Directories

What is a Directory?

A directory is a sub folder within the main website folder.

The directory contains files that are not required - or wanted - in the root folder.

Directories are used in conjunction with the drop down navigation to organise the pages of large sites and to stop the navigation menu taking over the page. Once a site has grown to more than around twenty pages, directoried should be used.

A directory can be added to the left sidebar in EverWeb from the File menu, the Toolbar or by using Option + Command + N.

The directory can be populated by dragging existing pages into it, creating new ones or duplicating a Template Page.

The pages in the directory will appear in the drop down section of the navigation menu below the directory name.

<meta http-equiv="refresh" content="0;url=page.html" />

A directory is actually just a folder containing files - just like its paper equivalent.

Confusingly, EverWeb creates an index.html page along with the directory folder. This can be used for content but it may be better not to! Here's why...

When a visitor mouses over the directory name in the navigation and the drop down appears, the natural reaction is to pull the cursor down to the first - or any - page. Only the compulsive clickers will actually see any content that you put on the "directory" page.

This page could, and should, remain blank but what will a twitchy handed vistor think if they see this blank page?

The workaround is to use a completely blank page and add a meta refresh to the head code box in the page inspector.

Enter the page file name in the above code - marked in red. This should be the filename of the first "real" page in the directory.

As an example, in the screenshot on this page, the directory "Code" has a redirect to the page "code-insertion" so that meta refresh is this...

This website uses a slightly modified version of the default EverWeb navigation. It can be seen that the site is organized into sections - each of which is contained in a directory. The pages in each directory are listed in the drop down.

The screenshot to the right shows some of the directories in this site. When the arrow beside any one is turned down, the pages are revealed.

Directory Structure

<meta http-equiv="refresh" content="0;url=code-insertion.html" />

The zero in the code means that the visitor is redirected instantly, with no delay, and won't see the non existent content of the blank directory page.

That deals with the compulsive clicker and your "normal" visitors won't miss out on a valuable page!

EverWeb Directory Set Up

NOTE: As of the release version of EverWeb 1.7, there is a checkbox in the Page inspector for redirecting the Directory index.html to the first child page of the directory contents. Doing this will make the navigation incompatible with Android devices.