![]() |
PictoolsTemplates |
by Zweibieren
|
|
Templates define the appearance of "category" and "picture" pages. Each project can have its own templates, and thus its own appearance. For many projects, pictures fall naturally in a sequence of categories. Pictools presents the collection of pictures as a sequence of web pages, one page for each category. The category page displays thumbnails of the pictures: Clicking on a thumbnail switches to a page displaying the full image of the selected picture: ![]() For category pages the Next and Back buttons move to adjacent categories pages. For a picture page, the Next and Back buttons move through the full size pictures in the category. Captions appear on both kinds of pages, but on the category page it is just a popup as the mouse moves over the picture. |
||
|
Template
are in the distribution in pictools/picsrc/ and installed from
there into
${PICTOOLS}. You should tailor them there. And when you start a
project directory, copy the templates to it and tailor them some more.
They are further modified by
macro replacement through genhtml,
as called by gendirs in MakeTargets. In particular the
Back or Next button is replaced with an Up button for the end pictures
in the sequence.
Sections below describe each of the templates. The category pages are generated from a template called template.tpl and the picture pages come from frame.tpl. A third template, pictd.tpl, defines the appearance of each thumbnail; for instance, the caption could be made to appear directly on the page. The distributed versions of both template.tpl and frame.tpl have at their end a macro inclusion of another template, pagetrailer.txt; it provides a place to put copywrite and date stamp information. Copies of the templates as distributed are on this website at template.tpl, frame.tpl, pictd.tpl, and pagetrailer.txt. |
template.tplThis template is used in gendirs and gensite to generate a header page showing thumbnails of all the pictures. The instructions shown here are part of the file as distributed and need to be removed before the file is used in earnest. (Links have been removed, but rendered with underlining and blue.) |
||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
Background A directory for displaying pictures has these files: Makefile template.tpl (a modified version of this file) frame.tpl (modified) captions.cap index.hin The Makefile is three lines: DIGESTDIR = full name of directory containing the pictures include ${PICTOOLS}/MakeVars include ${PICTOOLS}/MakeTargets The captions.cap file (or any .cap file) is a series of segments. Each segment begins with a line file: segmentname Segment title ... The segment is the pictures named on the following lines, up to the next segment line. Each picture has a line [imagename.ext] caption words ... When 'make build ' is performed, a subdirectory is created for each segment. It is named segmentname. Generated into that subdirectory is an index.html file and for each picture line, a file imagename.html. The index.html file is an instantiation of this file. template.tpl. The per-image files are instantiations of frame.tpl. The index.hin file should contain references to the segments. It can do this with the line $include(captions-titles.txt) So the segment directory is a subdirectory of the one with the files noted above. From that segment directory we have index.html
is the index to the segment of pictures
instantiated from template.tpl
../index.html is index
to all
segments of picturesgenerated from index.hin
../../index.html is the
main
page for the project(assuming that the pictures
directory is a subdirectory of the project page)
Warning Note that this template is instantiated into ./segmentname. So in it, the values of href= in <a> tags and src= in <img> tags must have an additional "../" at the beginning. (That is, a reference to ../images/foo.png, must appear in this template as ../../images/foo.png) Tasks
For early work you may want to use the unmodified template.tpl found in the pictools/picsrc directory of the distribution. Leave at least the variables section intact. After first building the site (with 'make') look at the generated files. The variables descriptions lines below will be augmented with the actual values of the variables as the file was processed.
|
||||||||||||||||||||||||||||||
frame.tplGendirs generates a page for each picture to show it in the larger format. This page derives from the frame.tpl template. Here is a sample. (Links have been removed, but rendered with underlining and blue.) |
|||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||
| See the Background in template.tpl, above. Tasks
The following variables may be used. After instantiation, the values will appear within the parentheses.
|
|||||||||||||||||||||||||||
pictd.tplGenhtml instantiates this template for each thumbnail it generates for the $pictures macro. It implants the image like this:
The default version is usually sufficient; it shows the picture and uses the caption as a popup. You can revise the file or adjust the appearance with a CSS style sheet. The generated code gives elements these classes:
|
||||||||||||||||||||||||||||||||||||
The following variables
will be expanded in pictd.tpl files. All are set by genhtml or the Makefile.
|
||||||||||||||||||||||||||||||||||||
| Copyright 2008, Zweibieren |
8 Aug 2008 11:38 PM
|
Page
maintained
by
Zweibieren ![]() |