Hi Paul, I just had a quick look over your comments. Sounds like the go ahead. I'll write more tomorrow when Im a bit fresher, its real late here now. Finlay On Wed, 2002-10-02 at 20:35, paul POULAIN wrote:
Finlay Thompson wrote:
i Everyone,
It seems that everyone had a email conversation about the way templating is being done in koha. I have been working on templating the opac. Let me explain what I have done, which is not to say that it is the right way :-)
Firstly I should point out that I have been developing on the rel-1-2 branch, but will probably merge this into the 1.3 release.
Did you commit it ? I'm not sure, i see almost nothing. If you've commited, let me know how many (and which) files are in the CVS.
If you want to go and check it out go to http://opacdev.katipo.co.nz you can login using user:pword = frank:frank or finlay:finlay
CVS: All the templates are going into the koha-tmpl tree of cvs. under this root we have two sub-branches intranet-tmpl/ and opac-tmpl/ eveything onder there should be installed in koha/intra/htdocs/ and koha/opac/htdocs/ respectivly.
OK, that's clear. Hope everybody reads this.
And then we have the structure: <theme>/<lang>/<scriptname>.tmpl I suggest that we try hard to keep the templates and scripts with the same names.....
not try very hard, but MUST...
includes and images go under the <theme>/<lang>/ directory.....
An example: The opac-search.pl script presents the search form in the opac. see: http://opacdev.katipo.co.nz/cgi-bin/koha/opac-search.pl
it calls the opac-search.tmpl template which in this instance is found in the default/en/ theme and language.
There is an include at the top: cat-top.inc and this is found in default/en/includes/cat-top.inc all the images in the templates are prefixed by the HTML::Template tag: <TMPL_VAR NAME="themelang"> eg. src="<TMPL_VAR NAME='themelang'>/images/search-button.gif" This template variable is automatically passed to includes and is automatically loaded into the template by the template loading subroutine.....
Nice, fast and clear. Great.
Template loading: The relevant code in opac-search.pl is:
use C$::Output; my $template = gettemplate("opac-search.tmpl", "opac");
So, the picktempate sub can be dropped (in Output.pm from both 1.2 and main branch) ? and most templated scripts must be touched (1-2 line modify)
I will update the reading material on: http://koha.org/contribute/templating/
Finlay
Looking at your code (v1.2) show : * we must add 2 rows in systempref table : -> opaclanguages -> opacthemes (note : why having opac and not intranet ?)
* we must add 2 lines in the config file : -> opachtdocs -> intrahtdocs
Am I right ? If yes, then, you're the templating coordinator, so I agree, and will soon move already templated scripts to the good directory structure. But i'll wait for your confirmation (am i right ? is there scripts that you still haven't commit ?) -- Paul