Where Mura is Installed - Mura Docs v7.1

Where Mura is Installed

As a Mura theme developer, you're going to be working with the file system. So, it's important to have an understanding of where Mura is located, and how you can reference this information programmatically, via code. Because at some point, you're going to need this kind of information when generating links to, and from, your own template files.

{context}

The location on your file system of where Mura is actually installed, is referred to as the {context}.

While the vast majority of Mura installations occur at the webroot, some organizations may have Mura installed in a subdirectory of the webroot. It doesn't matter if it's only one level deep, or ten levels deep. Mura is able to ascertain its installation directory, and can help you obtain the information with a simple code snippet.

For example, on a typical Windows server, it might be installed in the following directory:

C:\inetpub\wwwroot\

We can easily reference this information with a simple code snippet in Mura:

m.globalConfig('context')

Listed below are examples of what the m.globalConfig('context') Mura code snippet would return, based on where Mura is installed on the file system.

Install Location Return Value
C:\inetpub\wwwroot\ Empty string
C:\inetpub\wwwroot\muraplatform\ /muraplatform
C:\inetpub\wwwroot\somedirectory\muraplatform\ /somedirectory/muraplatform

The usage of this Mura code snippet, and many others, will be covered much more in depth, as well as how to use them, in another section. At this point, it's important to just keep the {context} in mind, and that there's a way to find out what it is.