PLG getDocumentationUrl

From GeeklogWiki
Jump to: navigation, search

In some situations, Geeklog will need a link to a plugin's documentation. The following plugin API function provides this information:

function PLG_getDocumentationUrl($type, $file)

Where $type is the internal name of the plugin (e.g. 'spamx') and $file is a name for the part of the documentation being requested.

On the plugin side, this would be implemented as

function plugin_getdocumentationurl_foo($file)

Documentation Links

Currently, $file can be one of the following:

  • 'index' - a link to the index page of the plugin's documentation
  • 'config' - a link to the part of the plugin's documentation where the configuration options are explained (see below for details)

We may want to add support for more values of $file in the future, e.g. 'help' to link to the plugin's help, etc.


  • When the plugin does not offer the file type requested, it should return false or an empty string.
  • The URLs do not have to be in the same directory or even on the same site.
  • The caller should not make any assumptions about the URLs.
  • The documentation doesn't have to be provided as static HTML pages - it could just as well be created dynamically, i.e. link to a .php script.

Config Links

Geeklog will request a file type 'config' to link to a description of the plugin's configuration options from the Configuration admin panel (the (?) links next to the configuration options).

Geeklog will attach an anchor of the form #desc_optionname to the supplied URL, assuming that such an anchor exists on the page so that the user will be taken directly to the description of the option in question.