Modifying Mura's Modules
Mura's base modules (display objects) are located under the following directory:
{context}/core/modules/v1/
As illustrated in the image below, there are more modules than the ones listed.
You shouldn't modify any of the files in these directories directly. If you choose to do so, you run the risk of your changes being overwritten whenever Mura is updated to the latest version.
Instead, copy the desired directory and all of its files, then paste it under one of the locations listed in the "Lookup Hierarchy" section below. Then, you can safely make your modifications without fear of losing any of your changes the next time Mura is updated.
Registering a Custom "modules" Directory
While Mura automatically scans for modules in the directories specified in the "Lookup Hierarchy" section below, you may register a custom "modules" directory using the code example below.
m.siteConfig().registerModuleDir( dir='/path/to/your/modules/' );
The directory path should be a logical path to a CFML directory, and is usually registered in the onApplicationLoad()
event.
Lookup Hierarchy
As mentioned under "The 'Modules' Directory" section, Mura uses the following lookup hierarchy when searching for modules, and aborts the lookup process once the target module has been located:
- Registered Module Directory
{RegisteredModuleDirectory}/
- A pre-registered module directory path. See "Registering a Custom 'Modules' Directory" section above.
- Module
../{module}/modules/
- A nested "modules" directory nested within a known module.
- Theme
../themes/{ThemeName}/modules/
- Theme modules are only used when the specified theme is actively assigned to a site. Keep in mind themes may be located under either the global themes directory (
{context}/themes/{ThemeName}
), or under a site ({context}/sites/{SiteName}/themes/{ThemeName}
).
- Site
{context}/sites/{SiteName}/modules/
- Site modules are shared across all themes within the specific site.
- Global
{context}/modules/
- Global modules are shared across all sites under a single Mura instance.
- Core
{context}/core/modules/v1/core_assets/modules/
- These are the "core" modules or display objects which may be copied and placed into any of the directories above to be safely modified.
Note: You should not edit the "core" modules directly. If you do, you run the risk of losing your edits or changes whenever you update Mura to the latest version.