Modifying Mura's Display Objects - Mura Docs v7.0

Modifying Mura's Display Objects

Mura's base display objects are located under the following directory:

{context}/{SiteID}/includes/display_objects/

As illustrated in the image below, there are more display objects 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, you should copy the directory, and its included files, and paste it under one of the following locations:

  • {context}/plugins/{PluginName}/display_objects/
    • This directory is known as a plugin's "display_objects" directory. Modified display objects in this directory are used only when the plugin itself is active.
  • {context}/{SiteID}/includes/themes/{ThemeName}/display_objects/
    • This directory is known as the theme's "display_objects" directory. Modified display objects in this directory are used only when the theme itself is active.
  • {context}/{SiteID}/includes/display_objects/custom/
    • This directory is known as the site's custom "display_objects" directory. Modified display objects in this directory are used, regardless of which theme is active. The exception to this rule is if the same display object has been modified and placed under the theme's "display_objects" directory above.

Registering a Custom "display_objects" Directory

In addition to the directories listed above, you may register a custom "display_objects" directory using the code example below.

m.siteConfig().registerDisplayObjectDir(
dir='/path/to/your/display_objects/'
);

The directory path should be a logical path to a CFML directory, and is usually registered in the onApplicationLoad() event.

Lookup Hierarchy

Mura uses the following lookup hierarchy when searching for display objects, and aborts the lookup process once the target display object has been located:

  1. {RegisteredDisplayObjectDirectory}/
  2. {context}/plugins/{PluginName}/display_objects/
  3. {context}/{SiteID}/includes/themes/{ThemeName}/display_objects/
  4. {context}/{SiteID}/includes/display_objects/custom/
  5. {context}/{SiteID}/includes/display_objects/