[docs] Partially revert the last doc change.
[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`` which, when
6 loaded, overrides various settings in the core ``ini``-file to provide:
7
rgrp 8 * A path to local customisations of the core templates and stylesheets
9 * A "stream filter" that replaces arbitrary strings in rendered templates
10 * A "route" to override and extend the default behaviour of a core CKAN page
11
12 * A custom Pylons controller for overriding some core CKAN behaviour
13
14 * A custom Package edit form
15
Ian Murray 16 * A custom User registration and edition form
17
rgrp 18 * Some simple template customisations
19
Seb Bacon 20 Installation
21 ============
22
23 To install this package, from your CKAN virtualenv, run the following from your CKAN base folder (e.g. ``pyenv/``)::
24
rgrp 25 pip install -e git+https://github.com/okfn/ckanext-example#egg=ckanext-example
Seb Bacon 26
rgrp 27 Then activate it by setting ``ckan.plugins = example`` in your main ``ini``-file.
Seb Bacon 28
29
30 Orientation
31 ===========
32
rgrp 33 * Examine the source code, starting with ``ckanext/example/plugin.py``
Seb Bacon 34
35 * To understand the nuts and bolts of this file, which is a CKAN
36 *Extension*, read in conjunction with the "Extension
David Read 37 documentation": http://docs.ckan.org/en/latest/plugins.html
Seb Bacon 38
39 * One thing the extension does is set the values of
40 ``extra_public_paths`` and ``extra_template_paths`` in the CKAN
41 config, which are "documented
David Read 42 here": http://docs.ckan.org/en/latest/configuration.html#extra-template-paths
Seb Bacon 43
44 * These are set to point at directories within
David Read 45 ``ckanext/example/theme/`` (in this package). Here we:
46 * override the home page HTML ``ckanext/example/theme/templates/home/index.html``
47 * provide some extra style by serving ``extra.css`` (which is loaded using the ``ckan.template_head_end`` option
48 * customise the navigation and header of the main template in the file ``layout.html``.
Seb Bacon 49
50 The latter file is a great place to make global theme alterations.
51 It uses the _layout template_ pattern "described in the Genshi
52 documentation":http://genshi.edgewall.org/wiki/GenshiTutorial#AddingaLayoutTemplate.
53 This allows you to use Xpath selectors to override snippets of HTML
54 globally.
55
Ian Murray 56 * The custom package edit form at ``package_form.py`` follows a deprecated
57 way to make a form (using FormAlchemy). This part of the Example Theme needs
58 updating. In the meantime, follow the instructions at:
59 http://readthedocs.org/docs/ckan/en/latest/forms.html
60
61