The #DOSSIER_SQUELETTE
tag such as the #CHEMIN
tag is used to develop easily transportable and exchangeable templates.
The #CHEMIN
tag, which searches for a file in all the templates, plugins or SPIP should be preferred most of the time.
#DOSSIER_SQUELETTE
tag returns the path of the directory in which the tag is used. Just like #SQUELETTE
returns the name of the file.
Note: these tags are therefore quite similar to the constants __DIR__
and __FILE__
in PHP.
Example:
This allows you to call the files attached to the template in the template directory: for example with this structure
-
article.html
-
css/my_style.css
We can write in the template article.html
:
<link rel="stylesheet" href="#DOSSIER_SQUELETTE/css/my_style.css" type="text/css" />
This will load the css/mon_style.css
related to article.html
.
Prefer #PATH
:
In most cases, however, the #CHEMIN
tag will be preferred in this way, which facilitates possible overloading of files:
<link rel="stylesheet" href="#CHEMIN{css/mon_style.css}" type="text/css" />