Merge branch 'master' of git+ssh://maxious.lambdacomplex.org/git/ckanext-datagovau
[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
5 * A CKAN Extension "plugin" at ``ckanext/example/plugin.py``
rgrp 6 which, when loaded, overrides various settings in the core
Alex Sadleir 7 ``ini``-file to provide:
8
Alex Sadleir 9 * A path to local customisations of the core templates and stylesheets
10 * A "stream filter" that replaces arbitrary strings in rendered templates
Alex Sadleir 11 * A "route" to override and extend the default behaviour of a core CKAN page
12
Seb Bacon 13 * A custom Pylons controller for overriding some core CKAN behaviour
14
15 * A custom Package edit form
16
17 * Some simple template customisations
Alex Sadleir 18
John Glover 19 Installation
Alex Sadleir 20 ============
John Glover 21
Alex Sadleir 22 To install this package, from your CKAN virtualenv, run the following from your CKAN base folder (e.g. ``pyenv/``)::
23
24 pip install -e git+https://github.com/okfn/ckanext-example#egg=ckanext-example
25
John Glover 26 Then activate it by setting ``ckan.plugins = example`` in your main ``ini``-file.
27
28
29 Orientation
30 ===========
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
36 documentation":http://packages.python.org/ckan/plugins.html
37
38 * One thing the extension does is set the values of
39 ``extra_public_paths`` and ``extra_template_paths`` in the CKAN
40 config, which are "documented
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
45 the home page, provide some extra style with an ``extra.css``, and
46 customise the navigation and header of the main template in the file ``layout.html``.
47
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
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