
Updated for 1.8
If you are looking to overwrite the default index page on your Elgg install, then it is best to do this as a plugin in order to keep the upgrading of your Elgg install as pain free as possible.
The main Elgg index runs a plugin hook called 'index,system'. If this returns true, it assumes that another front page has been drawn and doesn't display the default page.
Therefore, you can override it by registering a function to the 'index,system' plugin hook and then returning true from that function. This means you can write exactly the front page you want without having to edit core Elgg. The Elgg community site runs on an untouched Elgg core altered through plugins, for example.)
Here's a quick overview:
<?php function pluginname_init() { // Replace the default index page elgg_register_plugin_hook_handler('index', 'system', 'new_index'); } function new_index() { if (!include_once(dirname(dirname(__FILE__)) . "/pluginname/pages/index.php")) return false; return true; } // register for the init, system event when our plugin start.php is loaded elgg_register_event_handler('init', 'system', 'pluginname_init'); ?>
In 1.8, the following functions were added which deprecated old and inconsistently named functions from previous Elgg versions:
See http://docs.elgg.org/w/index.php?title=Tutorials/Indexpage&oldid=3672 for the original 1.7 version of this tutorial.