FOR ARCHIVAL PURPOSES ONLY

The information in this wiki hasn't been maintained for a good while. Some of the projects described have since been deprecated.

In particular, the "Ushahidi Platform v3.x" section contains information that is often misleading. Many details about this version of Platform have changed since.

This website is an extraction of the original Ushahidi wiki into a static form. Because of that, functions like logging in, commenting or searching will not work.

For more documentation, please refer to https://docs.ushahidi.com

Skip to end of metadata
Go to start of metadata

So you want to add a new page to your Ushahidi 2.x install?  I tend to do this from a plugin - not because plugins are really easy, but because when the core Ushahidi code changes, you're not left trying to remember which pages you edited and how.

I'm building the datascience plugin.  Here's what I did to create the simple page shown above:

  • added file "main.php" to directory plugins/datascience/views/datascience
  • added file "datascience.php" to directory plugins/datascience/controllers

main.php contains:

<div id="content">
<div class="content-bg">

<h1>This is a title</h1>
This is some content
</div>
</div>

datascience.php contains: 

class DataScience_Controller extends Main_Controller
{
 public function index()
 {
$this->template->content = new View('datascience/main');
}
}


Notes:

-datascience.php extends class Main_Controller: this puts your content into a standard Ushahidi frame. 

Extensions:

-To add another page, add another function. The name of the function will be what appears in the URL example: public function hello(){}  URL: (base)/index.php/datascience/hello

-To include a link to your new page in the navigation bar follow How To Write A Plugin 

  1. use the action "nav_main_top"  
  2. In the view for the button: <li><a href="?php echo url::base(TRUE) . 'datascience'?> Datascience </a></li>
    **this will link to your index