From 80c7ebec6c1e6c51ffb66a2cb13a4eed8f03fd27 Mon Sep 17 00:00:00 2001
From: "gerv%gerv.net" <>
Date: Fri, 4 Apr 2008 11:47:40 +0000
Subject: Bug 230742 - document new 'hooks' mechanism. This is my take on Myk's
text - probably still needs further polish.
---
docs/en/xml/customization.xml | 553 ++++++++++++++++--------------------------
1 file changed, 205 insertions(+), 348 deletions(-)
diff --git a/docs/en/xml/customization.xml b/docs/en/xml/customization.xml
index 37c64cca0..a9005665e 100644
--- a/docs/en/xml/customization.xml
+++ b/docs/en/xml/customization.xml
@@ -18,78 +18,45 @@
.
-
- Template Directory Structure
+
+ What to Edit
- The template directory structure starts with top level directory
- named template, which contains a directory
- for each installed localization. The next level defines the
- language used in the templates. Bugzilla comes with English
- templates, so the directory name is en,
- and we will discuss template/en throughout
- the documentation. Below template/en is the
- default directory, which contains all the
- standard templates shipped with Bugzilla.
+ The template directory structure is that there's a top level directory,
+ template, which contains a directory for
+ each installed localization. The default English templates are
+ therefore in en. Underneath that, there
+ is the default directory and optionally the
+ custom directory. The default
+ directory contains all the templates shipped with Bugzilla, whereas
+ the custom directory does not exist at first and
+ must be created if you want to use it.
-
-
- A directory data/templates also exists;
- this is where Template Toolkit puts the compiled versions of
- the templates from either the default or custom directories.
- Do not directly edit the files in this
- directory, or all your changes will be lost the next time
- Template Toolkit recompiles the templates.
-
-
-
-
-
- Choosing a Customization Method
-
- If you want to edit Bugzilla's templates, the first decision
- you must make is how you want to go about doing so. There are two
- choices, and which you use depends mainly on the scope of your
- modifications, and the method you plan to use to upgrade Bugzilla.
-
-
+ There are two different ways of editing Bugzilla's templates,
+ and which you use depends mainly on the method you plan to use to
+ upgrade Bugzilla.
The first method of making customizations is to directly edit the
- templates found in template/en/default.
- This is probably the best way to go about it if you are going to
- be upgrading Bugzilla through CVS, because if you then execute
- a cvs update, any changes you have made will
- be merged automagically with the updated versions.
+ templates in template/en/default. This is
+ probably the best method for small changes if you are going to use
+ the CVS method of upgrading, because if you then execute a
+ cvs update, any template fixes will get
+ automagically merged into your modified versions.
-
-
- If you use this method, and CVS conflicts occur during an
- update, the conflicted templates (and possibly other parts
- of your installation) will not work until they are resolved.
-
-
-
- The second method is to copy the templates to be modified
- into a mirrored directory structure under
- template/en/custom. Templates in this
- directory structure automatically override any identically-named
- and identically-located templates in the
- default directory.
+ If you use this method, your installation will break if CVS conflicts
+ occur.
-
-
- The custom directory does not exist
- at first and must be created if you want to use it.
-
-
-
- The second method of customization should be used if you
- use the overwriting method of upgrade, because otherwise
- your changes will be lost. This method may also be better if
+ The other method is to copy the templates to be modified into a
+ mirrored directory
+ structure under template/en/custom. The templates
+ in this directory automatically override those in default.
+ This is the technique you
+ need to use if you use the overwriting method of upgrade, because
+ otherwise your changes will be lost. This method is also better if
you are using the CVS method of upgrading and are going to make major
changes, because it is guaranteed that the contents of this directory
will not be touched during an upgrade, and you can then decide whether
@@ -98,9 +65,9 @@
- Using this method, your installation may break if incompatible
- changes are made to the template interface. Such changes should
- be documented in the release notes, provided you are using a
+ If you use this method, your installation may break if incompatible
+ changes are made to the template interface. If such changes are made
+ they will be documented in the release notes, provided you are using a
stable release of Bugzilla. If you use using unstable code, you will
need to deal with this one yourself, although if possible the changes
will be mentioned before they occur in the deprecations section of the
@@ -109,25 +76,21 @@
- Regardless of which method you choose, it is recommended that
- you run ./checksetup.pl after creating or
- editing any templates in the template/en/default
- directory, and after editing any templates in the
- custom directory.
+ Don't directly edit the compiled templates in
+ data/template/* - your
+ changes will be lost when Template Toolkit recompiles them.
-
-
- It is required that you run
- ./checksetup.pl after creating a new
- template in the custom directory. Failure
- to do so will raise an incomprehensible error message.
+
+ It is recommended that you run ./checksetup.pl
+ after any template edits, especially if you've created a new file in
+ the custom directory.
-
+
-
+
How To Edit Templates
@@ -135,7 +98,7 @@
If you are making template changes that you intend on submitting back
for inclusion in standard Bugzilla, you should read the relevant
sections of the
- Developers'
+ Developers'
Guide.
@@ -153,7 +116,7 @@
to properly HTML filter data that has been passed into the template.
This means that if the data can possibly contain special HTML characters
such as <, and the data was not intended to be HTML, they need to be
- converted to entity form, i.e. <. You use the 'html' filter in the
+ converted to entity form, ie <. You use the 'html' filter in the
Template Toolkit to do this. If you forget, you may open up
your installation to cross-site scripting attacks.
@@ -162,18 +125,16 @@
Also note that Bugzilla adds a few filters of its own, that are not
in standard Template Toolkit. In particular, the 'url_quote' filter
can convert characters that are illegal or have special meaning in URLs,
- such as &, to the encoded form, i.e. %26. This actually encodes most
+ such as &, to the encoded form, ie %26. This actually encodes most
characters (but not the common ones such as letters and numbers and so
on), including the HTML-special characters, so there's never a need to
HTML filter afterwards.
- Editing templates is a good way of doing a poor man's custom
- fields
.
+ Editing templates is a good way of doing a "poor man's custom fields".
For example, if you don't use the Status Whiteboard, but want to have
- a free-form text entry box for Build Identifier
,
- then you can just
+ a free-form text entry box for "Build Identifier", then you can just
edit the templates to change the field labels. It's still be called
status_whiteboard internally, but your users don't need to know that.
@@ -181,29 +142,22 @@
-