<img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=1639164799743833&amp;ev=PageView&amp;noscript=1">
Diagram Views

CMS Content Rendering, Part 3: Additional Content Maker Features

Brad McDavid
#CMS, #Episerver-Ektron Merger, #Episerver, #Ektron, #Code
Published on July 20, 2015
warren-wong-323107-unsplash-1

In the final installment of our blog series on content rendering, we discuss some additional features of Diagram's Content Maker code: menus, language glossaries, and global and folder settings.

At Diagram, we work extensively with both the EPiServer and Ektron CMS platforms, and ever since the merger between the two companies was announced, we’ve been closely following the updates about the combined platform. However, there are still plenty of websites using the current Ektron and EPiServer platforms, and we want to help them get the most out of their investment.

One particularly useful feature of Ektron and EPiServer is structured content, which separates the data entered into the CMS from the form and style in which it is published. We’ve previously discussed how EPiServer and Ektron display content and how to use Diagram’s Content Maker code to provide additional content rendering functionality to the Ektron platform. In this final installment of our blog series about content rendering, we will focus on how to make use of additional features within the Content Maker. These features include menus, language glossaries, and site and folder settings.

Menus

Menus in the Content Maker use an INavigation interface and are typically populated from the built-in Ektron menu objects defined within the work area. Menu objects can be retrieved using the Diagram.EktronCms.ContentMaker.NavigationFactory helper class’s Get method, where a menu ID, language ID, cache interval, and array of INavigationResolver are needed. The INavigationResolver interface allows for flexibility in manipulating the navigation items as they are created. A couple of navigation resolvers are provided by default: Diagram.EktronCms.ContentMaker.Resolvers. NavigationItemSelectedResolver and Diagram.EktronCms.ContentMaker.NavigationItemVisibleResolver, which can set the selected state based on dynamic content and menu item visibility by CMS permissions.

Below is an example of code used to get a menu:

Language Glossaries

Most websites utilize elements such as site search place holder text, button text, and form labels to display important UI information to site visitors, especially for multilingual sites. The best place for this text to be stored is in the CMS, along with all the other site content. Content Maker provides a simple way to handle this multilingual content through a language glossary.

The language glossary is made of a few simple components: a smart form with a repeatable key/value area, a content model that implements the Diagram.EktronCms.ContentMaker.Interfaces.IGlossary interface, and the Diagram.EktronCms.ContentMaker.GlossaryFactory helper class’s TranslateKey method. The smart form provides an area for content editors to change values anytime, without the assistance of a developer. However, new keys will require the assistance of a developer to be placed on the site. There is very minimal effort in adding a new key once the glossary is set up:

An optional parameter in the translate key method is also flexible enough to support multiple types, which can be used to segment glossaries for site sections.

Global and Folder Settings

The final components included within the Content Maker code are settings objects. These objects are almost identical, except for scope. Global settings are meant to be the same no matter where a piece of content is located within a website’s structure. Elements of site settings typically include the logo, copyright text, and menu ID references.

Folder settings use the context of the dynamic content’s location to apply settings such as callout information and section menu, and can even be used to override areas of the main settings if desired. This allows for easy setup of microsites within the same CMS, and even within the same ASP.Net page template. Using multiple types of folder settings can allow for a wide variety of setups, such as brand settings to store logos, colors, and menu ID references, and section settings to store callouts for a specific site section.

The components needed to utilize global and folder settings are the Diagram.EktronCms.ContentMaker.Interfaces.ISettings interface and the Diagram.EktronCms.ContentMaker.SettingsFactory<T> helper class’s GetSiteSettings and GetFolderSettings methods. The biggest difference between the two functions is that the folder settings need a content reference to find the correct folder settings, and global settings are the same no matter which folder the content belongs to.

More Power To You

At Diagram, we enjoy empowering our clients’ content editors and administrators to modify almost any element of a website. The functionality provided by our Content Maker code will allow for the creation of a very flexible website, along with a simplified developer experience. I hope you have enjoyed this series, and I’d love to hear any questions that you might have about Content Maker, so please share them in the comments below.