Component Layout Templates
As covered in the Content Manager Guide, Mura components are reusable content objects that can be shared across multiple pages or sections within your site. Theme developers will often want a way to control the look, feel, and even the functionality, of some of these components. For this reason, Mura offers a way to create special layouts, designed specifically and exclusively for components themselves.
How to Create a Component Layout Template
Mura automatically checks your theme's "templates" directory for a "components" directory. If the "components" directory is discovered, Mura will inventory all ".cfm" files within it, and include them as Layout Template options when editing a component. So, you would place your component layout templates under
If you reference MuraBootstrap3, the default theme that is included with Mura, and look under the "templates" directory, you should see a subdirectory labeled "components" with a couple of files in it.
If you open the example.cfm layout template, you'll notice a few lines of code. We'll cover template variables in another section, so for now, focus on the HTML included.
How to Apply a Layout Template to a Component
Follow the steps below to apply a layout template to a component.
- From the back-end administration area, go to the Content section, select the Tree View tab, then select the Components button.
- Either select an existing component you wish to edit, or create a new component.
- From the Create/Edit Component screen, select the Advanced tab.
- Locate the Layout Template field, and choose your desired layout from the select menu.
- After completing the form, select your desired publishing option to save your component.
- If you've created a new component, and wish to add it to a page or section of your site, please visit the Component Display Object Type section of the Content Manager Guide.