From 613a558af3a82420784f433580b487c5e80b031d Mon Sep 17 00:00:00 2001 From: "jocuri%softhome.net" <> Date: Fri, 4 Apr 2008 11:47:48 +0000 Subject: Patch for bug 233245: update documentation of formats to include ctypes as well; patch by Niels Reedijk slightly modified by me. --- docs/en/xml/customization.xml | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) (limited to 'docs/en/xml') diff --git a/docs/en/xml/customization.xml b/docs/en/xml/customization.xml index 418ce89b6..e52f0a636 100644 --- a/docs/en/xml/customization.xml +++ b/docs/en/xml/customization.xml @@ -143,21 +143,28 @@
- Template Formats + Template Formats and Types - Some CGIs have the ability to use more than one template. For - example, buglist.cgi can output bug lists as RDF or two - different forms of HTML (complex and simple). (Try this out - by appending &format=simple to a buglist.cgi - URL on your Bugzilla installation.) This - mechanism, called template 'formats', is extensible. + Some CGI's have the ability to use more than one template. For example, + buglist.cgi can output itself as RDF, or as two + formats of HTML (complex and simple). The mechanism that provides this + feature is extensible. + + + + Bugzilla can support different types of output, which again can have + multiple formats. In order to request a certain type, you can append + the &ctype=<contenttype> (such as rdf or html) to the + <cginame>.cgi URL. If you would like to + retrieve a certain format, you can use the &format=<format> + (such as simple or complex) in the URL. - To see if a CGI supports multiple output formats, grep the + To see if a CGI supports multiple output formats and types, grep the CGI for "GetFormat". If it's not present, adding - multiple format support isn't too hard - see how it's done in + multiple format/type support isn't too hard - see how it's done in other CGIs, e.g. config.cgi. @@ -176,17 +183,27 @@ You now need to decide what content type you want your template - served as. Open up the localconfig file and find the + served as. The content types are defined in the + Bugzilla/Constants.pm file in the $contenttypes variable. If your content type is not there, add it. Remember the three- or four-letter tag assigned to you content type. This tag will be part of the template filename. + + + + After adding or changing a content type, it's suitable to edit + Bugzilla/Constants.pm in order to reflect + the changes. Also, the file should be kept up to date after an + upgrade if content types have been customized in the past. + + Save the template as <stubname>-<formatname>.<contenttypetag>.tmpl. Try out the template by calling the CGI as - <cginame>.cgi?format=<formatname> . + <cginame>.cgi?format=<formatname>&ctype=<type> .
-- cgit v1.2.3-24-g4f1b