SPIP
Article validated
The article « #URL_ECRIRE (#URL_ECRIRE - SPIP) »
was validated by George.
#URL_ECRIRE
Friday 30 December 2022 , by jack
The #URL_ECRIRE
tag generates the URL of a private area script if it
exists.
This tag allows you to write links to the ?exec
scripts in the private
area.
Thus, [<a href="(#URL_ECRIRE{unscript})"> ... </a>]
will call
/ecrire?exec=unscript
.
If the script does not exist (i.e. if there is no file of the name
indicated, in the exec
directories known to SPIP and the installed
plug-ins), this tag returns nothing, and consequently the whole template
extract above will return the empty string. This is very convenient for
producing a link only if the plug-in that responds to it is installed.
It is possible to complete the URL with a Query-String, by giving it as a
second argument to the tag:
#URL_ECRIRE
{formulaires_voir,id_formulaire=
#ID_FORMULAIRE
}
If there is a need to pass more than one parameter, it is also possible to
use the filter parametre_url
(SPIP)
With no arguments, this tag returns the URL of the home page of the private
area.
For information on ecrire Extending SPIP
(SPIP)
To generate a URL for the public area, use #URL_PAGE
(SPIP)
— Sent by SPIP (https://www.spip.net/)