Environment Variables

The CMS will set these variables on your plugin before calling your init() and showSlot() methods. They give you information about where plugin is currently running from.

You can use syntax of the form:

$this->variableName

to access these variables from your PHP code.

$this->cID

The id of the current content item.

$this->containerId

The HTML/DOM id of the div element that your Plugin has been placed in.

$this->cType

The type of the current content item, e.g. documenthtmlpicture...

$this->cVersion

When an admin or a visitor is looking at a content item, this contains the version of a content item which is currently in view.

In visitor mode this will always be equal to the cms_core::$visitorVersion variable.

$this->eggId

The nested id of your Plugin, if your Plugin is placed in a Nest.

$this->instanceId

The id of the currently running instance of your Plugin, from the plugin_instances table.

$this->instanceName

The name of the currently running instance of your Plugin, from the plugin_instances table.

$this->isVersionControlled

This environment variable will be true for version controlled plugins, and false for library plugins.

$this->moduleClassName

The class name of the currently running Module.

$this->moduleClassNameForPhrases

This stores the VLP classname used for phrases in your Plugin.

$this->moduleId

The id of the currently running Module, from the modules table.

$this->slotLevel

This enivornment variable will be set to 1, 2 or 3 depending on the scope that your Plugin is currently running at. Template Familiy level is 3, Template Level is 2, and Content Item level is 1.

$this->slotName

The name of the Slot that your Plugin is running from.

$this->tabId

If this Plugin is part of a tabbed Plugin Nest, $this->tabId will store the Tab's id in the nested_plugins table.

If this Plugin is not part of a Nest, or the Plugin is part of a Nest but no tabs have been set up, $this->tabId will be 0.