[Koha-cvs] CVS: koha/koha-tmpl templates.readme,1.2,1.3

Ambrose Li acli at users.sourceforge.net
Mon Jan 20 05:06:05 CET 2003


Update of /cvsroot/koha/koha/koha-tmpl
In directory sc8-pr-cvs1:/tmp/cvs-serv1009

Modified Files:
	templates.readme 
Log Message:
Minor updates with minor spelling corrections. Some hyphenations removed to
conform to normal English usage.

Reformatted with "par 72" with manual adjustments for bullet points


Index: templates.readme
===================================================================
RCS file: /cvsroot/koha/koha/koha-tmpl/templates.readme,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** templates.readme	20 Jan 2003 03:53:32 -0000	1.2
--- templates.readme	20 Jan 2003 04:06:03 -0000	1.3
***************
*** 6,59 ****
  
    The advantage of a templating-system is the separation of code and
!   design.  It is much easier to read the html and get an imagination of
    what it will look like without having it shattered by declarations and
    functions.  And it is also nicer being able to alter some functions
!   without worrying about the webdesign.
  
!   On the other hand templating stands in contradiction on scripting the
!   procedural way, it forces obect-oriented programming.
  
!   With templates Koha can be made fully skinnable, we speak of themes,
    and can support different languages.
  
  2. How does it work
  
!   The short version: Instead of printing html from your script you only
!   define some template-parameters.
  
!   You design your html-page without code in it and where you need to
!   insert data generated by the script you can pass this data from the
!   template-parameters via special tags.
  
!   Indeed there is a little more to know.
  
    I recomend reading the documentation to the HTML::Template-module.
!   You ca obtain it from http://www.perldoc.com/cpan/HTML/Template.html
  
  3. How is it implemented in Koha
  
!   Koha uses templates to handle different themes and languages.  There
!   is a CVS-module for the design-files: koha-tmpl.
  
!   It contains two directories for the opac- and the intranet-templates:
    opac-tmpl and intranet-tmpl.
  
    Each of this directories reflects the available themes and their
    languages.  The default theme is "default" and the default language is
!   "en" (we use the 2letter-abbreviations, en => english, fr => french,
!   de => german and so on).
  
!   If you for example want to write a template for the opac
!   part of the "custommade"-theme in polish it has to go in
    koha-tmpl/opac-tmpl/custommade/pl/template.tmpl.
  
!   The template-files will not reside in your webtree, if
!   you want to use a image you have to put this in your
!   webtree, which is organized the same way as the templatetree
    (koha-html/opac-html/custommade/pl/images/image.gif).
  
    If you have files (either templates or files in the webspace)
    which are the same for all themes or languages use the
!   "all"-directory. For example the "background.jpg"-image, which
    is the same for all languages within a theme should go in
    koha-html/(intranet|opac)-html/custommade/all/images/background.jpg).
--- 6,61 ----
  
    The advantage of a templating-system is the separation of code and
!   design.  It is much easier to read the HTML and get an imagination of
    what it will look like without having it shattered by declarations and
    functions.  And it is also nicer being able to alter some functions
!   without worrying about the web design.
  
!   On the other hand, templating stands in contradiction on scripting the
!   procedural way; it forces object-oriented programming.
  
!   With templates Koha can be made fully skinnable: we speak of themes,
    and can support different languages.
  
  2. How does it work
  
!   The short version: Instead of printing HTML from your script, you only
!   define some template parameters.
  
!   You design your HTML page without code in it, and where you need to
!   insert data generated by the script. You can pass this data from the
!   template parameters via special tags.
  
!   Indeed, there is a little more to know.
  
    I recomend reading the documentation to the HTML::Template-module.
!   You can obtain it from http://www.perldoc.com/cpan/HTML/Template.html
  
  3. How is it implemented in Koha
  
!   Koha uses templates to handle different themes and languages.  In
!   the CVS module "koha", there is a subdirectory for the design files:
!   koha-tmpl.  This subdirectory can be checked out from CVS as if it
!   were a CVS module "koha-tmpl".
  
!   It contains two directories for the OPAC and the intranet templates:
    opac-tmpl and intranet-tmpl.
  
    Each of this directories reflects the available themes and their
    languages.  The default theme is "default" and the default language is
!   "en" (we use the 2-letter abbreviations, en => English, fr => French,
!   de => German and so on).
  
!   If you, for example, want to write a template for the OPAC
!   part of the "custommade" theme in Polish, it has to go in
    koha-tmpl/opac-tmpl/custommade/pl/template.tmpl.
  
!   The template files will not reside in your web tree. If
!   you want to use an image, you have to put this in your web
!   tree, which is organized the same way as the template tree
    (koha-html/opac-html/custommade/pl/images/image.gif).
  
    If you have files (either templates or files in the webspace)
    which are the same for all themes or languages use the
!   "all"-directory. For example the "background.jpg" image, which
    is the same for all languages within a theme should go in
    koha-html/(intranet|opac)-html/custommade/all/images/background.jpg).
***************
*** 80,118 ****
  5. Rules and hints
  
!  5.1 for the templates
  
!   -use absolut paths, relative paths in html-tags would be relative to
!   the script's position and relative paths in <TMPL_INCLUDE> would be
!   relative to the template.
  
!   -you don't have to make templates for everything in your custom-theme
!   or language. if you omit a template in a language the template of next
!   available language is used (languages are tried in the order of the
!   user's browser-settings).
  
!    if there is no template in the specified language in a theme a
!    different language will be chosen and NOT a different theme.
  
!    if you omit a template in all languages the template of the
!    default-theme will be used.
  
!   -include comments with useful information such as the template's
!   location, this simplifies debugging
  
!   -use the same name for the template and the script (with different
!   extensions of course)
  
   5.2 for the scripts
  
!   -use meaningfull english (abbreviations) as parameter-names
  
!   -if you fetch a list of data, pass it completely and let the designer
!   decide which data to use.
  
!   -working with arrays and loops is always better, even if you have only
!   three similar rows.
  
!   -don't let the script generate html and pass the output to the
!   template
  
  6. Templating stuff in Koha
--- 82,120 ----
  5. Rules and hints
  
!  5.1 For the templates
  
!   - Use absolute paths; relative paths in html-tags would be relative to
!     the script's position and relative paths in <TMPL_INCLUDE> would be
!     relative to the template.
  
!   - You don't have to make templates for everything in your custom-theme
!     or language. If you omit a template in a language, the template of
!     next available language is used. (Languages are tried in the order of
!     the user's browser settings.)
  
!     If there is no template in the specified language in a theme, a
!     different language will be chosen and NOT a different theme.
  
!     If you omit a template in all languages, the template of the default
!     theme will be used.
  
!   - Include comments with useful information such as the template's
!     location; this simplifies debugging
  
!   - Use the same name for the template and the script (with different
!     extensions of course)
  
   5.2 for the scripts
  
!   - Use meaningfull English (abbreviations) as parameter names
  
!   - If you fetch a list of data, pass it completely and let the designer
!     decide which data to use.
  
!   - Working with arrays and loops is always better, even if you have
!     only three similar rows.
  
!   - Don't let the script generate html and pass the output to the
!     template
  
  6. Templating stuff in Koha
***************
*** 124,130 ****
    description here (e.g. function calls and return values).
  
!   -function %path = pathtotemplate(%hash) in C4::Output
  
!    Takes a hash with the following keys:
  
      -template: the name of the template-file (e.g. 'mytemplate.tmpl')
--- 126,132 ----
    description here (e.g. function calls and return values).
  
!   - function %path = pathtotemplate(%hash) in C4::Output
  
!     Takes a hash with the following keys:
  
      -template: the name of the template-file (e.g. 'mytemplate.tmpl')





More information about the Koha-cvs mailing list