зеркало из https://github.com/mozilla/gecko-dev.git
Patch for bug 233245: update documentation of formats to include ctypes as well; patch by Niels Reedijk <n.reedijk@planet.nl> slightly modified by me.
This commit is contained in:
Родитель
921a00668f
Коммит
2a16ad08a3
|
@ -143,21 +143,28 @@
|
|||
|
||||
|
||||
<section>
|
||||
<title>Template Formats</title>
|
||||
<title>Template Formats and Types</title>
|
||||
|
||||
<para>
|
||||
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 <filename>&format=simple</filename> 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,
|
||||
<filename>buglist.cgi</filename> can output itself as RDF, or as two
|
||||
formats of HTML (complex and simple). The mechanism that provides this
|
||||
feature is extensible.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
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
|
||||
<filename><cginame>.cgi</filename> URL. If you would like to
|
||||
retrieve a certain format, you can use the &format=<format>
|
||||
(such as simple or complex) in the URL.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
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.
|
||||
</para>
|
||||
|
||||
|
@ -176,17 +183,27 @@
|
|||
|
||||
<para>
|
||||
You now need to decide what content type you want your template
|
||||
served as. Open up the <filename>localconfig</filename> file and find the
|
||||
served as. The content types are defined in the
|
||||
<filename>Bugzilla/Constants.pm</filename> file in the
|
||||
<filename>$contenttypes</filename>
|
||||
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.
|
||||
</para>
|
||||
|
||||
<note>
|
||||
<para>
|
||||
After adding or changing a content type, it's suitable to edit
|
||||
<filename>Bugzilla/Constants.pm</filename> 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.
|
||||
</para>
|
||||
</note>
|
||||
|
||||
<para>
|
||||
Save the template as <filename><stubname>-<formatname>.<contenttypetag>.tmpl</filename>.
|
||||
Try out the template by calling the CGI as
|
||||
<filename><cginame>.cgi?format=<formatname></filename> .
|
||||
<filename><cginame>.cgi?format=<formatname>&ctype=<type></filename> .
|
||||
</para>
|
||||
</section>
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче