Importing Content in Mura 6.2
April 2, 2015 by Michael Evangelista
In our last article, we explored some of the possibilities when using the new Export Content option in Mura CMS 6.2 (See the Mura CMS 6.2 release announcement for an overview of bug fixes, security enhancements and new features, as well as notable improvements to some existing features in this release.)
You Can Get There From Here
With the addition of the new Export Content and Import Content features, copying content from one Mura site to another, even a site in a separate Mura instance altogether, requires only a few quick operations inside the familiar Site Manager interface. Exported content can be imported as the child elements of any content item, allowing for versatile duplication even within the same Mura site.
We'll explore a few potential use cases, based on a photo gallery and the pages of a blog as examples.
Once the content has been exported using the simple "Export Content" option in the Mura Site Manager, and the resulting .zip file saved in a readily accessible location, the process to import the content into another Mura CMS site is equally simple.
The Export and Import options are available as part of the "Actions" menu when editing any content item via the Mura Site Manager. Imported content can be placed under any item in the Mura content structure, regardless of its original location in the site from which it was exported. Any item in the Site Manager can be used as the destination for imported content.
Example 1: Cloning a Photo Gallery
In the previous article about the Export Content [ LINK ] feature, we created two sample export scenarios. In the first, we exported an entire photo gallery complete with the parent "Gallery" page. To replicate the gallery contents on a new site, we will import the content below the home page, so it becomes a top level navigation item.
The destination site contains a standard navigation bar, without a Gallery item. By importing the gallery as a child of the home page, we will create a new top level navigation item for the gallery automatically.
To import the content, we'll use the option under the "Actions" menu on the home page in the Site Manager.
The Import Content dialog presents two options. First, select the exported zip file created previously from its location on the hard drive. Then, select the status for the published content. We have selected "Published" to show the new content immediately.
If selecting "Draft", the content is saved with a draft or unpublished status and is not shown immediately on the website. If selecting "Save to Change Set" , an additional option appears, prompting for a change set name, and the content can be managed via traditional Change Set operations.
Managing the Imported Content
Once imported, the new content behaves just like native content within the Mura site. All standard options and attributes are imported, and the content nodes appear in the Site Manager's "Architectural View" as children of the parent upon which the import operation was performed. Imported content can be reordered or edited just like any standard Mura content items.
With our selection of "Published" status, the content is visible immediately on the public facing website. A new navigation menu item appears, and the Gallery is ready for viewing, including the lightbox photo zoom behavior. Since the import process does not include theme styles or any or template rendering files, the appearance of the new content will match that of the existing site theme. In this case, the destination site's gallery styling is automatically applied to our imported content, and no further action is required.
Example 2: Merging Blog Content
In our second example [LINK], we exported only the child pages of an existing blog, without the parent content item, using the options in the Export Content dialog. This option is useful when merging similar content sections, such as collections of news articles or blog publications. In this case, we will select an existing "Blog" main page in our destination site as the location for the imported content.
Like the first example, by selecting the previously exported .zip file containing our content and the "Published" status option, the imported entries are added to our existing blog section, marked with the current date and time in the Updated column.
As with the gallery example, the new content is visible immediately on the site into which it was imported, and inherits the styling and appearance of that site's theme. When merging standard Mura content, no further action is required to obtain a completely seamless integration. In other cases, importing content which utilizes custom Class Extensions and Extended Attributes may require additional coding or styling to achieve the desired output.
These are just a few examples of the many ways in which the Export Content and Import Content features can be used to duplicate and extend Mura CMS content in multiple locations. In future articles, we'll take an in-depth look at more of the exciting new features available in Mura 6.2.
More About This Feature
Also see Mura CMS v6 Documentation: Import Content. Further documentation for Mura CMS developers and content managers is available at docs.getmura.com. Learn more about Mura's powerful features and flexible options at www.getmura.com.