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.
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:
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.
Have questions or comments about this post? We'd love to hear from you.
Google search algorithm updates can wreak havoc on your website’s traffic. Don't let your organic rankings tank. Our free SEO health check can help you identify issues that make Google unhappy with your site.
Like what you read?
Subscribe to our blog "Diagram Views" for the latest trends in web design, inbound marketing and mobile strategy.