Implementation of an IGroupForm
[ckanext-datagovau.git] / README.rst
1 This CKAN Extension demonstrates some common patterns for customising a CKAN instance.
2
3 It comprises:
4
rgrp 5 * A CKAN Extension "plugin" at ``ckanext/example/plugin.py``
6 which, when loaded, overrides various settings in the core
7 ``ini``-file to provide:
rgrp 8
9 * A path to local customisations of the core templates and stylesheets
10 * A "stream filter" that replaces arbitrary strings in rendered templates
11 * A "route" to override and extend the default behaviour of a core CKAN page
12
13 * A custom Pylons controller for overriding some core CKAN behaviour
14
15 * A custom Package edit form
Ross Jones 16
17 * Some simple template customisations
18
Ian Murray 19 Installation
20 ============
rgrp 21
22 To install this package, from your CKAN virtualenv, run the following from your CKAN base folder (e.g. ``pyenv/``)::
Seb Bacon 23
24 pip install -e git+https://github.com/okfn/ckanext-example#egg=ckanext-example
25
26 Then activate it by setting ``ckan.plugins = example`` in your main ``ini``-file.
27
rgrp 28
Seb Bacon 29 Orientation
rgrp 30 ===========
Seb Bacon 31
32 * Examine the source code, starting with ``ckanext/example/plugin.py``
33
34 * To understand the nuts and bolts of this file, which is a CKAN
35 *Extension*, read in conjunction with the "Extension
rgrp 36 documentation":http://packages.python.org/ckan/plugins.html
Seb Bacon 37
38 * One thing the extension does is set the values of
39 ``extra_public_paths`` and ``extra_template_paths`` in the CKAN
David Read 40 config, which are "documented
Seb Bacon 41 here":http://packages.python.org/ckan/configuration.html#extra-template-paths
42
43 * These are set to point at directories within
44 `ckanext/example/theme/`` (in this package). Here, we override
David Read 45 the home page, provide some extra style with an ``extra.css``, and
Seb Bacon 46 customise the navigation and header of the main template in the file ``layout.html``.
47
David Read 48 The latter file is a great place to make global theme alterations.
49 It uses the _layout template_ pattern "described in the Genshi
50 documentation":http://genshi.edgewall.org/wiki/GenshiTutorial#AddingaLayoutTemplate.
51 This allows you to use Xpath selectors to override snippets of HTML
Seb Bacon 52 globally.
53
54 * The custom package edit form at ``package_form.py`` follows the
55 conventions in the "main CKAN
56 documentation":http://packages.python.org/ckan/forms.html
57