Web Development
Cracking the Code - How To Use ACC's Web Templates

The Code

The code that resides inside of the ACC web template files is quite simple. It consists of a few statements that retrieve the HTML markup necessary to build the page.

<?php include("http://www.austincc.edu/modules/template/external/1.php"); ?>

<title>PageName</title>

<!-- Attach Scripts and extra CSS below -->

<?php include("http://www.austincc.edu/modules/template/external/2.php"); ?>

<body>

<?php include("http://www.austincc.edu/modules/template/external/3.php"); ?>

<!-- Title of website -->

SiteName

<?php include("http://www.austincc.edu/modules/template/external/4.php"); ?>

<!-- Relative link to local menu -->

<?php include("menu.php"); ?>

<?php include("http://www.austincc.edu/modules/template/external/5.php"); ?>

<!-- Title of page -->

PageName

<?php include("http://www.austincc.edu/modules/template/external/6.php"); ?>

<!-- Your content goes here. -->

Your content goes here.

<?php include("http://www.austincc.edu/modules/template/external/7.php"); ?>

<? echo "Last modified: ".date( "F d Y \@ \ g:i a", filemtime($_SERVER['SCRIPT_FILENAME']) ); ?>

<?php include("http://www.austincc.edu/modules/template/external/8.php"); ?>

As a user, all that is required is entering in your content in the appropriate areas. The areas that you should edit are as follows:

<title>PageName</title> - The title of the page goes here

SiteName - The title of the overall website goes here

PageName - The title of the page goes here. Tip: it’s often the same as the first editable area.

Your content goes here. – This is the main content area. Anything you wish to put on your webpage goes within this area.

Once these areas are edited, users can save the document with any name they see fit, so as long as it ends with the “.php” extension. From that point users can upload the file to their web directory.

The Menu

As we can see that menu.php which is provided with the template consists of a simple unordered list. menu.php :

<ul>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
</ul>

Linking to the menu is done through a PHP statement:

<!-- Relative link to local menu -->

<?php include("menu.php"); ?>

Users can either use full, local, or relative links from their menu. Users are cautioned to always check their menu links when adding, moving, or renaming files.

Examples:

<ul>
<li><a href="page1.php">Link</a></li>
<li><a href="page2.php">Link</a></li>
<li><a href="page3.php">Link</a></li>
</ul>

<ul>
<li><a href="http://www.austincc.edu/yourwebsite/page1.php">Link</a></li>
<li><a href="http://www.austincc.edu/yourwebsite/page1.php">Link</a></li>
<li><a href="http://www.austincc.edu/yourwebsite/page1.php">Link</a></li>
</ul>