config.cfm - Mura Docs v6

config.cfm

The config.cfm file is not required, but rather is a common convention in Mura CMS plugins as the place to put any configuration code your plugin might need. Most importantly, it is a common location for placing the code that will provide your plugin access to the Mura Scope ($) and PluginConfig. This is especially important in the administrative side of your plugin, as the Mura Scope and pluginConfig may not be available by default.

/MyFirstPlugin/plugin/config.cfm

A typical config.cfm would look something like this:

<cfscript>
if ( !IsDefined('$')) {
$ = application.serviceFactory.getBean('muraScope').init('default');
}
if ( !IsDefined('pluginConfig') ) {
pluginConfig = $.getPlugin('MyFirstPlugin');
}
</cfscript>