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