Skip to content
Go to file

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


This document is a manual for index.php, ~170 lines of procedural php that serves  index.php was written by Andrew Kittredge for Jeremy Duffield in early 2010.  This manual instructs the user on modification and subtraction/addition of/to the site's content, modification of the menu elements or front page image is not covered, no instruction or advice is given on style, layout, formating, or css.

index.php allows non-technical users to modify and add content to the site (the html served by index.php will henceforth be "the site".)  The site's content resides in directories below the index.php file.  Organization of content as presented on the site is controlled by the arrangement of the directories and files containing the content.  Read and write access to the directories is required to modify their contents.  

As implemented for the Duffield Lab site there are five category directories, contact, interests, people, publications, and protocols, corresponding to the five tabs on the site's menu.  Below the category directories is a mix of directories and files.  In general, index.php translates directories into the site's headings.  The directory name is stripped of underscores, capitalized and used as the sections heading.  The exceptions are directories with names begining with . or .., which are ignored, and directories whose name contains the string content_.

index.php translates folders with names containing content_ into links to content pages, with an associated, optional, image and or summary.  An image file named front_page_picture.png in a "content_" directory will be rendered above the link to the content page, a file named summary.html will be rendered as html above the link.

index.php renders a file titled my_file.html in a content_ directory for the page served after clicking on a content_ link.  For better or worse, my_file.html is served word for word within the site's borders.  The most obvious downside to the treatment of my_file.html is the difficulty of handling images with in the content.  To include an image in the content use a text editor to edit the raw html.  Locate the <img src="..."> tag for the image to be included.  Append @@@path_to_html@@@ to the begining of the image's title.  For example, to include an image titled content_image.png in the content page change the html tag <img src="content_image.png"> to the <img src="@@@path_to_html@@@content_image.png".

index.php creates a link for each file in directories other than content_ directories.  In the Duffield Lab implementation this functionality is used for the protocols.  The links index.php builds for the files point to the files themselves.  The behavior after clicking on a file link is dependent on the browser and the file type.  In general, .html and .txt files will render in the browser.

The order of content can be controlled by appending integers to the file or directory name.  The directory _01_content_john_doe will render before _02_content_jane_doe, directories and files without an ordering parameter will be rendered in no particular order after ordered files.

So far, the behavior of index.php when it encounters various files and folders has be explained.  To change the site simply add or modify those files and folders.  To add another person to the PEOPLE page add a directory content_persons_name to the appropriate directory, save the person's bio as my_file.html in content_persons_name.  To remove a protocol from the protocols page navigate the directory and delete the protocol file.


Source for



No releases published


No packages published