Login to Your Account


Login using your Facebook account

Join the Mercury Community

Click on all the boats to prove you're human.


How To Home | more...

Mercury Directory Structure

The folder structure in Mercury has two parts: global files and per-site files.  The global files are layed out the same as the Mercury subfolder in the per-site files so we will look at the per-site folders first.

Top Level Per-Site

In the root there are two folders:  html and mercury-config.  If you are hosting your site on a shared Mercury server then you won't even see the mercury-config folder, you will only see the html folder.

The mercury-config folder contains two files that specify paths that Mercury will use and database connection information.  These files are outside of the web root for security purposes.

The stock html folder has a few folder underneath it:  content, css, images, mercury, scripts, seo.  It is worth pointing out that the majority of Mercury sites will be running on Linux and case matters.

Folders Under html

Let's start with the obvious ones.

The images folder is where you should put your images.  It is exempt from URLrewriting and files will be served as is.

The scripts folder is where you should put your javascript files.  It is also exempt from URLrewriting and files will be served as is.

The css folder is where you should put your style sheet files.  It is also exempt from URLrewriting and files will be served as is.

The seo folder is used by Mercury to perform URL translations.  You can safely ignore it for now and revisit it later in the document about Mercury and custom SEO URLs.

The content folder is where Mercury stores content that is uploaded by the administrators or by users of your site.  The recommended practice is for each module to store its content in a folder called content/mercury-modules/modulename with any necessary folder hierarchy underneath that.  You can safely ignore this folder as well unless you are developing modules that need to store server-side content.

You may make your own folders with any names that do not conflict with the ones listed.  You can put HTML files in these folders or PHP files.  Be forewarned that if you put additional content like images, javascript or CSS files in any locations other than the ones specified above then you might be unexpected results do the inclusion of a layout.  There are ways around it, see the section on using AJAX with Mercury.

 The mercury folder will get its own section...

The mercury folder

The html/mercury folder will typically hold a subfolder for each module that you want to use.  Files may exist in the top level of a module folder or in subfolders called display and functions.

If you want the module to show up in the admin then you must add a file called .enabled to the root of the module folder.  The file can be empty, it simply has to exist.  Example: html/mercury/forums/.enabled

The display and functions folders are used to store overrides for display files and module functions.  Most of the time you will be customizing display files.  You may choose to override a Mercury function but this will be far less common.  These folders are also used for the creation of custom modules.  This will be addressed in another document.