PluginConfig

Access to the pluginConfig object depends on the base object that's being extended.

If the component extends='mura.plugin.pluginGenericEventHandler' then use:

If the component extends='mura.cfobject' then use:

The pluginConfig provides developers with access to the properties configured in the /plugin/config.xml{.cfm}.

As well as plugin-specific Application and Session objects.

Retrieving a Plugin's pluginConfig

If you need to retrieve a plugin's pluginConfig object from outside of that plugins normal phase of execution you can access it by using the base extends='mura.cfobject' method getPlugin(). This method takes a single argument of either pluginID, moduleID, name or package.

Retrieving a pluginConfig by the value of the plugin's 'Package' element in the /plugin/config.xml allows developers to have a consistent way of referencing the plugin from one instance of Mura to another.

Application Object

The pluginConfig object has it own application object that provides a container for key value pairs that you would like to persist for the plugin. It has an optional purge boolean argument to tell the pluginConfig to return a brand new object which defaults to false.

Session Object

The pluginConfig object has it own session object that provides a container for key value pairs that you would like to persist for users interacting with the plugin. It has an optional boolean purge argument to tell the pluginConfig to return a brand new object which defaults to false.

Retrieving a Plugin's Assigned Sites

You can retrieve a query of a plugin's assigned sites by using the pluginConfig.getAssignedSites() method.

Adding to the HTMLHead or HTMLFoot Queues

The pluginConfig object also allow developers to add the current requests HTMLHeadQueue:

The "path" argument is a file path starting from the root of your plugin.

  • {plugin root}/htmlhead/inc.cfm

The contents of "inc.cfm":

Add inc.cfm to the HTMLHeadQueue:

One import note is that if the code that you are injecting into the head of the page requires the JS library to be loaded (e.g., jquery) you need to explicitly do so.