Homepage Features

The department homepage needed to sport an ever-changing variety of content, showing off the current news and events, advertising upcoming seminars, perhaps giving a detailed profile of a randomly chosen faculty member or student — all independent content that just happens to belong on the same page.

To facilitate this, I crafted the notion of a "Homepage Feature". The homepage dynamically loads any content found in the features directory, and arranges each page there as box on the homepage.

A feature can be as simple as a block of static HTML advertising a unique upcoming event, or can use arbitrarily complex PHP to produce dynamic content, perhaps changing automatically on a daily or weekly basis.

In the demonstration site, the homepage sports a News feature, and a separate Seminars feature, with both pulling data from the core "CS Website" database.

Example Feature (saved as features/example.php):

<?php
$title = 'Example Feature';
?>

<p>This is an example feature, with just a simple paragraph of
text.  To be more dynamic, it can use arbitrary PHP and can access
the core database for the CS site.</p> 

Because the site always displays everything found in the features directory, the webmaster doesn't need to do anything besides add a new file there to add a new section to the homepage.