2007-12-31: Minor release with feature enhancements. More...
2007-09-08: Small bug fix release. More...
2007-06-29: Some bug fixes and one small feature enhancement. More...
Plugin name: | Tag/Relocatable (Tag/Default) |
---|---|
Author: | Thomas Leitner <t_leitner@gmx.at> |
Summary: | Adds a relative path to the specified name if necessary |
Parameters: | path (=default mandatory parameter): nil resolveFragment: true |
Handled tags: | relocatable |
This tag ensures that the relative path to the referenced file is always correct.
It is used to change the directory part of the supplied path name and is most often used in template
files. A relocatable tag looks like this: {relocatable: default.css}
. If this was put into a
template and the template was used by a file in a subdirectory, then the relocatable
tag would put
../default.css
into the output file; thus ensuring that the relative path to file is valid!
However, if the specified path is an absolute URL, it will just return it.
Be aware that the tag resolves the specified path by using the output names (and the standardized page names) of the nodes. Also, if the path points to a directory, the path to its index file is returned.
Additionally, if you add an URL fragment to the path, it will also be checked if it exists. This can
be turned off by setting the parameter resolveFragment to false
.
Usage | Output |
---|---|
{relocatable: /default.css} | ../../../default.css |
{relocatable: ../core/configuration.page} | ../core/configuration.html |
{relocatable: ../core} | ../core/index.html |