indexpage.rst 1021 B

12345678910111213141516171819202122232425262728293031323334
  1. Customizing the Home Page
  2. #########################
  3. Overwrite the default index page on your Elgg install.
  4. start.php
  5. =========
  6. Register a function for the plugin hook called ``index, system`` that returns ``true``.
  7. This tells Elgg to assume that another front page has been drawn so it doesn't display the default page.
  8. Inside start.php you will need something like the following:
  9. .. code:: php
  10. <?php
  11. function pluginname_init() {
  12. // Replace the default index page
  13. elgg_register_plugin_hook_handler('index', 'system', 'new_index');
  14. }
  15. function new_index() {
  16. return !include_once(dirname(__FILE__) . "/pages/index.php");
  17. }
  18. // register for the init, system event when our plugin start.php is loaded
  19. elgg_register_event_handler('init', 'system', 'pluginname_init');
  20. pages/index.php
  21. ===============
  22. Then implement the page handler script (/pluginname/pages/index.php) to generate the desired output.
  23. Anything output from this script will become your new home page.