IUPUI is Indiana's premier urban research university. The campus enrolls more than 30,000 students in 21 schools and academic units.
Note: If your site is hosted on webserve (IU Central Servers), view instructions for webserve.
On this page:
The header, navigation, and footer are three separate files which must live on your webserver. Each page on your website will include the content, and include code to automatically combine content, header, navigation, and footer for a complete webpage when served to a visitor's web browser.
You can set up the file structure however it makes the most sense in your environment. This is an example of a possible structure on an Apache server:
/www/template.html
/www/includes/head.inc
/www/includes/foot.inc
/www/includes/navigation.inc
/bin/automation.php
Since the header and footer must be regularly synched, those files must be frequently copied to your webserver. This can be automated, requiring no effort on your part once the automation is set up.
Due to the sensitivity of campus JAGALERT emergency communications, it is highly recommended that these updates occur several times per hour.
In short, simply copy these files from the campus website to the appropriate location on your server:
Header: http://www.iupui.edu/sitetools/head2.inc
Footer: http://www.iupui.edu/sitetools/foot.inc
Most server operating systems have scheduling functionality to allow the scheduling of a variety of server functions. In this case, you will schedule the server to copy files as mentioned above.
OCM is most familiar with UNIX servers and utilizes the cron scheduling application to accomplish this synchronization. Learn more about the UNIX cron command.
Now you have your web space, which includes a folder called sitetools and a file called .htaccess. Let's create your navigation file include. This file can be modified at any time, and will then be reflected across all pages.
<div id="leftNav"> <h2><a href="http://www.iupui.edu/~yoursite/">Home</a></h2> <ul> <li id="head2" class="subhead"><a href="http://www.iupui.edu/">Heading 1</a> <ul id="head2-sub"> <li><a href="http://www.iupui.edu">Page 1</a></li> <li><a href="http://www.iupui.edu">Page 2</a></li> <li><a href="http://www.iupui.edu">Page 3</a></li> </ul> </li> <li id="head3" class="subhead"><a href="http://www.iupui.edu/">Heading 2</a> <ul id="head3-sub"> <li><a href="http://www.iupui.edu">Page 1</a></li> <li><a href="http://www.iupui.edu">Page 2</a></li> <li><a href="http://www.iupui.edu">Page 3</a></li> </ul> </li> </ul> </div>
The code above as it is would render this.
The only edits you should make on this are the URLs and the page names. You will want to replace "Home" with your site name. You can add or subtract pages as you, as long as you use the same scheme. Do not change things like "leftNav" as these are pulled directly off the IUPUI style sheet, and refer to it. If you change the "id" or "class" you will not be consistent with the template.
Each OS and scripting environment allows your files to "include" or "import" content from the header, footer, and navigation files on your server. The exact code depends on your environment.
We'll create a basic HTML page, which will draw from the includes, and you'll have a basic template page for your site, which you can then modify and copy to build your site.
On APACHE, the file would look like this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Page Name : Department Name : IUPUI</title> <!--#include virtual="/sitetools/head2.inc"--> <!--#include virtual="/nav_test.inc"--> <div id="main" class="column wide"> <h2>Title</h2> <p>Text</p> </div> <!--#include virtual="/sitetools/foot.inc"-->
IUPUI is Indiana's premier urban research university. The campus enrolls more than 30,000 students in 21 schools and academic units.