relPath.gp



Creator information
Current maintainer :Karl Heinz Kremer
Author(s) :Karl Heinz Kremer
Recipe homepage :Karl Heinz Kremer's Home Page

Version history
The documentation file was last modified on Sat Jul 22 19:49:58 2000.

Overview
relPath.gp converts an absolute path to a path relative to the current input file
Compatible Genpage Versions
Version 1.0.3 and above.
Syntax
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.


Examples

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.


To-do List

Known Bugs
None known :)

Back to Top


This page generated using Genpage - Version: 1.0.7 on Fri Dec 18 17:45:49 2009

© Karl Heinz Kremer
1999