User Tools

Site Tools


dev:opac:template-toolkit

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
dev:opac:template-toolkit [2011/08/25 15:13] – [Customizing] aatredev:opac:template-toolkit [2012/03/27 00:20] – [Customizing] Put TPAC PO files in templates directory? dbs
Line 4: Line 4:
   * Create Date: 2011-03-08   * Create Date: 2011-03-08
  
-  * [[dev:opac:template-toolkit:todos|Development todos]]+  * <del>[[dev:opac:template-toolkit:todos|Development todos]]</del> deprecated 
 +  * [[dev:opac:template-toolkit:plan|Development plan]]
  
 ===== The Code ===== ===== The Code =====
  
-The code currently lives in an ESI Git branch called "template-toolkit-opac" You can view the code and watch changes [[http://git.evergreen-ils.org/?p=evergreen/equinox.git;a=shortlog;h=refs/heads/template-toolkit-opac|here]]. +On 2011-09-11, the code was merged to the master branch of the Evergreen git repository at http://git.evergreen-ils.org.
- +
-Downloading the code by creating a git clone of the branch +
- +
-<code> +
-$ git clone git://git.evergreen-ils.org/evergreen/equinox.git +
-$ cd equinox +
-$ git checkout -tb template-toolkit-opac origin/template-toolkit-opac +
-</code> +
- +
-The code changes frequently.  You can update the code by pulling changes from the repository. +
-<code> +
-$ git checkout template-toolkit-opac # just in case +
-$ git pull +
-</code> +
 ===== Installation ===== ===== Installation =====
  
Line 32: Line 18:
     * Locale::Maketext::Lexicon     * Locale::Maketext::Lexicon
  
-==== Installing Over an existing Evergreen installation (2.1+) ====+==== Installing over an existing Evergreen installation ====
  
-  - Copy these files from the repository into place on the file system.  Your mileage may vary on OS-dependent paths.  **Note:** Be careful not to clobber local changes you didn't want clobbered. +The TPAC needs to be installed as part of an overall system upgrade to master; it will be an integrated part of the Evergreen 2.2 release. 
-    *<code> + 
-$ sudo cp Open-ILS/examples/apache/eg_vhost.conf /etc/apache2/ +Pay close attention to the following files on upgrade: 
-$ sudo -u opensrf cp Open-ILS/examples/oils_web.xml.example /openils/conf/oils_web.xml +  * ''Open-ILS/examples/apache/eg_vhost.conf'' 
-$ sudo cp -r Open-ILS/src/perlmods/lib/OpenILS/WWW/* /usr/local/share/perl/5.10.1/OpenILS/WWW+  * Perl modules, including the previously mentioned prerequisites 
-$ sudo -u opensrf cp -r Open-ILS/src/templates/openils/var/</code> +  * ''Open-ILS/src/templates/*'', which now gets installed into ''/openils/var/templates/'' 
-  Edit /openils/conf/oils_web.xml and change <path>/openils/var/web/templates</path> to <path>/openils/var/templates</path> +  * ''Open-ILS/web/*'', which includes stylesheets under ''Open-ILS/web/css'' and images under ''Open-ILS/web/images'' that are required by the TPAC
-  - Reload or restart Apache+ 
-  Navigate to http://SERVER/eg/opac/home and you should see the KCLS-skinned server-side OPAC. +Navigate to http://SERVER/eg/opac/home and you should see the default server-side TPAC skin
  
 ==== Staff Client Integration ==== ==== Staff Client Integration ====
  
   * The eventual goal is to fully integrate the TT OPAC into the staff client.  Until it's complete, it's necessary to manually configure the staff client to use the new OPAC.   * The eventual goal is to fully integrate the TT OPAC into the staff client.  Until it's complete, it's necessary to manually configure the staff client to use the new OPAC.
-  * To use the Template Toolkit OPAC as the catalog in the staff client, as opensrf:<code> +  * To use the Template Toolkit OPAC as the catalog in the staff client, click the **Toggle Template Toolkit OPAC** link on the staff client landing pageYou might need to restart the staff client to make the change take effect.
-echo "urls['opac'] = '/eg/opac/advanced'; +
-urls['opac_rdetail'] = '/eg/opac/record/'; +
-urls['opac_rresult'] = '/eg/opac/results'; +
-urls['opac_rresult_metarecord'] = '/eg/opac/results?metarecord='; +
-urls['browser'] = urls.opac;" > /openils/var/web/xul/server/skin/custom.js;</code>+
  
 ==== Customizing ==== ==== Customizing ====
Line 61: Line 42:
  
   * Create a directory where you will store your template customizations, let's say ''/openils/var/my_own_templates''.   * Create a directory where you will store your template customizations, let's say ''/openils/var/my_own_templates''.
- +  Edit your Apache configuration to include the overriding template directory _after_ the main template directory:<code> 
-  Look for the node ''<template_paths>'' in your ''/openils/conf/oils_web.xml'' file. +# Templates will be loaded from the following paths in reverse order. 
- +PerlAddVar OILSWebTemplatePath "/openils/var/templates" 
-  * Add a new ''<path>'' child node directly //above// all existing ones so that everything within ''<template_paths>'' now looks something like this: +PerlAddVar OILSWebTemplatePath "/openils/var/my_own_templates" 
- +</code> 
-<code> +    * You can, for example, customize skins on the basis of the hostname being used via virtual hosts; note that the base template directory gets loaded first in eg_vhost.conf, so you're just specifying the customizations here:<code> 
-  <template_paths+<VirtualHost *:80
-    <path>/openils/var/my_own_templates</path> +        ServerName myhostname 
-    <path>/openils/var/templates</path+        DocumentRoot /openils/var/web/ 
-  </template_paths>+        DirectoryIndex index.xml index.html index.xhtml 
 +    Include eg_vhost.conf 
 +    <Location /eg> 
 +        PerlAddVar OILSWebTemplatePath "/openils/var/my_own_templates" 
 +    </Location
 +</VirtualHost>
 </code> </code>
- 
   * Place your version of all ''.tt2'' files that you would edit into a directory structure that mirrors that of the stock template path.  That is, if you want to have your own version of ''/openils/var/templates/default/opac/parts/topnav.tt2'', put it at ''/openils/var/**my_own_templates**/default/opac/parts/topnav.tt2''.   * Place your version of all ''.tt2'' files that you would edit into a directory structure that mirrors that of the stock template path.  That is, if you want to have your own version of ''/openils/var/templates/default/opac/parts/topnav.tt2'', put it at ''/openils/var/**my_own_templates**/default/opac/parts/topnav.tt2''.
  
Line 78: Line 63:
  
   * Reload Apache.   * Reload Apache.
 +
 +=== String Localization ===
 +
 +  * Create a ''.po'' file for your locale. Requires the ''Locale::Maketext::Extract::Plugin::TT2'' Perl module:<code>
 +sudo -u opensrf xgettext.pl --plugin=tt2 --directory=Open-ILS/src/templates/opac/ --output-dir=/openils/var/templates/locale --output=tpac.fr_CA.po</code>
 +  * Add your .po file to the Apache ''eg_vhost.conf'' file in the ''<Location /eg>'' section:<code>
 +    PerlAddVar OILSWebLocale "en_ca"
 +    PerlAddVar OILSWebLocale "/openils/var/templates/locale/tpac.en_CA.po"
 +    PerlAddVar OILSWebLocale "fr_ca"
 +    PerlAddVar OILSWebLocale "/openils/var/templates/locale/tpac.fr_CA.po"
 +</code>
 +  * Edit strings in your new .po file.  For example:<code>
 +...
 +#: Open-ILS/src/templates/opac/parts/topnav.tt2:34
 +msgid "My Account"
 +msgstr "Mon compte"
 +...</code>
 +  * Reload Apache.  (Translations are cached in the browser)
 +  * To test, reload the page with fr-CA as the browser's default locale
  
 === Custom Perl Handler === === Custom Perl Handler ===
dev/opac/template-toolkit.txt · Last modified: 2022/02/10 13:34 by 127.0.0.1

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki

© 2008-2022 GPLS and others. Evergreen is open source software, freely licensed under GNU GPLv2 or later.
The Evergreen Project is a U.S. 501(c)3 non-profit organization.