**Note**: More to come...

The EMEN2 web interface can be extended fairly easily.

First, create a directory with the following structure:


In example.py:

from emen2.web.view import View

class ExampleView(View):
    def example_test(self, value):
        self.title = 'Example extension'
        self.template = '/example/example'
        value = int(value)
        self.ctxt['value'] = value
        self.ctxt['value_square'] = value ** 2

In example.mako:

<%inherit file="/page" />


<p>This is an example of how to create a view and template.</p>

<p>The value argument was: ${value}</p>

<p>The value argument squared is ${value_square}, or ${value**2}</p>

And finally, in <ext>/views/init.py:

import example

EMEN2/Extensions (last edited 2013-07-17 07:00:51 by IanRees)