Blog
OpenEnergyMonitor

New emoncms features part 1: blue message bar

Spent a bit of time implementing new features for emoncms today, the first one was a much needed but quite small addition: a themed location to output messages such as "user already exists" and so on, see the blue bar in the screen below:



Try it out here: http://vis.openenergymonitor.org/emoncms3/

How it works

If you have a look at the user_controller here github user_controller.php
On line 28 and 29 you will see the following:

$output['content'] = "";
$output['message'] = "";
(ie line 65) $output['message'] = "Your new account has been created";

The returned output from the controllers used to be just the one variable $output now we have two, one for main body content output and the other for message bar output. These variables are passed through index.php to the theme The theme then places the message and content in separately themed locations. To engage in discussion regarding this post, please post on our Community Forum.