From 3ee60a58304dae7c33cc757ed9a6a0bbadf7355e Mon Sep 17 00:00:00 2001 From: John Martin Date: Tue, 30 Apr 2013 14:52:01 +0100 Subject: [PATCH] [#520] Added more context to how to add templates within an extension --- doc/templating.rst | 8 ++++++++ doc/theming.rst | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/doc/templating.rst b/doc/templating.rst index 5d34f1a6f11..8d38afbe1b4 100644 --- a/doc/templating.rst +++ b/doc/templating.rst @@ -162,6 +162,14 @@ for creating common form fields. They should generally be avoided as they are hard to extend and customise. +Templating within extensions +---------------------------- + +When you need to add or customize a template from within an extension you need +to tell CKAN that there is a template directory that it can call from. Within +your ``update_config`` method for the extension you'll need to add a +``extra_template_paths`` to the ``config``. + Custom Control Structures ------------------------- diff --git a/doc/theming.rst b/doc/theming.rst index aa2633e91ba..36a24f8aff8 100644 --- a/doc/theming.rst +++ b/doc/theming.rst @@ -77,7 +77,7 @@ has template inheritance which means that you don't have to re-write a whole template in order to change small elements within templates. For more information on how to exactly change the HTML of your CKAN instance: -please read the `Templating`_ documentation. +please read the `Templating > Templating within extensions`_ documentation. Including custom Stylesheets, JavaScript and images @@ -131,7 +131,7 @@ For more information on how CSS works in CKAN core: please read the .. _Jinja2: http://Jinja2.pocoo.org/ .. _markdown: http://daringfireball.net/projects/markdown/ .. _LESS: http://lesscss.org/ -.. _Templating: ./templating.html +.. _Templating > Templating within extensions: ./templating.html#templating-within-extensions .. _Resources > Resources within extensions: ./resources.html#resources-within-extensions .. _Building a JavaScript Module: ./javascript-module-tutorial.html .. _Front End Documentation > Stylesheets: ./frontend-development.html#stylesheets