Loading...
 
Skip to main content

Wiki插件

Tiki 的 wiki 插件是一种快速插入wiki语法,HTML 等的方法,可以有力地扩展基本的 wiki 语法。Wiki 插件用于在 Tiki 站点的任何 Wiki 文本区域中嵌入功能和交互式数据和功能,包括 wiki ,博客,文章,论坛等页面。重要的是,尽管它们被称为“插件”,但它们包含在 Tiki 安装中,而不是在 Tiki 的第三方或插件商店中。

Wiki 插件可用于:

  • 显示图像和播放视频或音频文件。
  • 按行和列排列内容,并创建特殊格式的表格和框。
  • 自动构建目录,显示反向链接或将访问者重定向到其他页面。
  • 显示图表,仪表,图纸和地图。
  • 显示用户和跟踪信息,查询数据库或显示其他页面的信息。
  • 以及更多......


许多插件默认启用。其他的可以很容易地从Text Area管理页面。作为一种安全措施,一些插件在成为“实时”页面之前需要经过管理员级别的批准。

 Tip
插件也很容易开发 - 请参阅 dev:Create a Plugin 有关如何入门的一些提示。

分布式插件

 Note
在页面的编辑窗口中,单击Image 图标,然后单击“插件帮助”以获取插件列表及其说明,以及插入语法和链接到文档的按钮。

插件语法

The way plugin syntax works in general is described below. The individual documentation page for a plugin also gives examples of the specific syntax for that plugin.

There are two basic styles of syntax, upper case, which works for virtually all plugins, and lower case, which works for plugins that do not require a body.

Uppercase Syntax

This syntax works for virtually all plugins (an exception is {maketoc}) and here is an example:

Copy to clipboard
{PLUGINNAME(parameter1="value1|value2" parameter2="value")} content affected by plugin and called body or data {PLUGINNAME}
  • Avoid spaces: No spaces in or around the tag names or parameter values, except between parameter names

  • Case sensitive: Tags must be in all caps

  • Ending tag: For plugins that do not require text in the body of the plugin (between the tags), a forward slash can be used instead of a closing tag as follows:
    {AGENTINFO(info="IP") /} instead of {AGENTINFO(info="IP")}{AGENTINFO}

  • Parameters:
    • Parentheses are always necessary even if no parameters are set. For example: {CODE()}
    • Parameters are separated by spaces, commas, or a comma and a space. Values within a parameter are usually separated by vertical bars (|) or colons (:) - check the documentation for the specific plugin to be sure
    • Either = or => can be used to separate parameters from values
    • It is best to enclose parameter values in single or double quotes, although the plugin may work without quotes if there are no spaces or unusual characters in the parameter values. Example: {CODE(wrap="1")}
    • Parameters you don't specify may be set to a default - check the documentation for that plugin for more information.

Lowercase Syntax

For plugins that do not require a body (i.e., content between the beginning and ending plugin tags), the lower case syntax can be used (since Tiki6). Here's an example:

Copy to clipboard
{pluginname parameter1="value1|value2" parameter2="value"}

Here's what's different about the syntax for these:

  • Only one tag, and it's in lower case
  • No parentheses for the parameters are needed
  • For example:
    {toc} instead of {TOC()}{TOC}
    {toc type="fancy"} instead of {TOC(type="fancy")}{TOC}

Site Settings for Plugins

Enabling Plugins

If not enabled by default, the site administrator must enable a plugin before it can be used by (since 3.0) going to Admin Home > Editing and Plugins > Plugins (tab) and checking the "Enable" box of that plugin and clicking "Change Preferences."

Enable Edit Plugin Icons

On the same tab (Admin Home > Editing and Plugins > Plugins (tab)), a feature called "Enable edit plugin icons" can be enabled, which will place an Image icon wherever there's a plugin. This edit icon will display a popup input form when clicked so that the plugin can be edited without editing and saving the whole page.

Toggle Plugin Edit Icons

Also, "Toggle display of section and plugin edit icons" can be enabled (at Admin Home > Wiki > General Preferences (tab) > Edit (section)). This will place an icon at the top of every page for turning section and plugin edit icons on or off with a single click (Image to toggle on and Image to toggle off).

Plugin Security

Plugins that are a potential security risk require approval by an administrator before they can be used - a notice will appear when that's the case.

Pending Approval Notification

There is a setting called "Plugin pending notification" in "Admin home > Editing and plugins > Plugins (tab)", which allows users in groups with the permission tiki_p_plugin_approve to receive an email notification each time a new plugin call is added in a wiki page as pending approval.




Created by popakrt. Last Modification: Monday 09 March, 2020 12:44:58 GMT-0000 by Marc Laporte.