relPath.gp
The documentation file was last modified on Sat Jul 22 19:49:58 2000.
relPath.gp converts an absolute path to a path relative to the current input file
Compatible Genpage Versions |
Version 1.0.3 and above.
relPath( aPath )
relPath() only has one form.
Use relPath to convert an absolute path to a path relative to
the current input file. This makes it possible to create a directory
hirarchy that can be copied to any place without having to modify any
paths referenced in any of he files.
This feature can be used e.g. when a personal home page hirarchy gets
moved from one provider to another without having to adjust for any
differences in the way the pages are stored.
If all images are stored in the directory /images then every
HTML file can access every image by using the following command in the
content file (or the template file):
$lt;!-- _GP_ relPath("/images/oneImage.gif") -->
If this command is used in the file content/one/two/three.content
the path will be converted to ../../images/oneImage.gif.
Firstly, include the relPath.gp recipe by calling <-- _GP_ recipe("$root/include/relPath.gp") --> somewhere in the content, that can be
either in one of the content files, or in the template file.
Every time this path relPath statement is found by genpage it will replace
the absolute path with the (hopefully) correct relative path.
- Come up with better ideas?
None known :)
This page generated using Genpage - Version: 1.0.7 on Fri Dec 18 17:45:49 2009
© Karl Heinz Kremer
1999