#PLUGIN

  • New in : SPIP 1.9.1

This tag is used to check for the existence of a plugin activated on the site, or to access all of the data stored in its plugin.xml file (no information is returned if the plugin has not been activated).

  • #PLUGIN{plugin_prefix} returns true if the plugin has been activated.
  • #PLUGIN{plugin_prefix,requested_data} returns the requested data from the plugin, such as its version number, its name, its description etc. of the plugin if it is active.
  • #PLUGIN{plugin_prefix, tout} returns all of the data from the plugin as an associative array that can be assigned to another variable so that you can display it using the |table_valeur filter.

The plugin prefix is the field entered the <prefix> XML field in the paquet.xml file which is always present at the root directory that contains the plugin’s scripts.

The most common use of the #PLUGIN tag consists of testing to see if the plugin has been activated or not before using an HTML code:

[(#PLUGIN{plugin_prefix}|oui) blablabla...]

will display "blablabla..." if the plugin_prefix plugin has been activated.

In php, the presence of the plug-in is tested using :

test_plugin_actif('prefix_plugin')

Author Mark Published : Updated : 18/07/23

Translations : عربي, català, English, Español, français, Nederlands