MarcusEdwards
Crownpeak (Retired)

Reusability and Modularity

Reusability, and modularity as a means of achieving reusability, is a common topic of interest when people are looking at a content management system. Let's take a look at how you can achieve this in Crownpeak DXM and Web Content Management platform.

Reuse should also be considered from two different user perspectives: a content manager, who is typically looking to reuse content; and developers, who are typically looking to reuse code.

Content Reuse

One of the virtues of the DXM platform is that customers can serve any number of websites from a single CMS instance as all content is maintained in the underlying CMS repository.

This makes it straight forward to reuse content across different contexts. To do this, Content Editors will be able to pick content that already exists in the repository.

Care needs to be taken in the underlying templates in how this linked content is used. The choices are:

  • Present a link to the published location of the referenced content; or
  • Including the referenced content in the template output. This will require having an additional output handler on the referenced asset to present the content in the same design as the referencing site.

The simplest way to have re-useable content is for this to be a considered at implementation time and have the underlying template output a fragment of markup that has as little presentation markup as possible. This allows the content fragment to be included into containing pages and have the site-specific design take effect.

Code Reuse

Code reuse is a frequent objective for customers. Consider a multi-national that has a "corporate affairs" site in different regions. Each region will want to have control of their content, including translations and other localisation.

Template Reuse

The most common way that this can be accomplished is by having multiple sites that use the same underlying templates. The unit of modularity here is the template.

Template reuse ensures a consistent look-and-feel across sites that allows content managers for each site to have full control of the content

Component Reuse

However, template reuse can lead to frustration when groups want to customise the output or have different arrangements of content sections. This naturally leads to the next logical unit of modularity: sections or components.

Implementations that want to use sections or components have templates that allow the content to be built up as a list of sections/components. These sections/components may be template specific -- these are the components that can be used on the homepage -- but it is often easier to have a rich set of sections/components and a small set of templates that use the full palette of sections/components.

Whichever route makes sense for your situation, the important thing is for reusability to be an early requirement. This ensure that all participants in the implementation from content managers to designs to coders are aligned on how and why reuse is being delivered.

Tools

One of the best ways to get this alignment is to have the team use a “design systems” approach and use any of the many tools available to do this:

  • Pattern Lab – Pattern Lab helps you and your team build thoughtful, pattern-driven user interfaces using atomic design principles.
  • Fabricator – Fabricator is a tool that provides an efficient, optimized working environment to help you build your toolkit.
  • Zeplin – focuses on improving the collaboration between designers and engineers, providing them the most accurate resources.

  • StorybookJS – An open-source tool for developing UI components in isolation for React, Vue, and Angular. .
Labels (1)

Can't find what you are looking for?

Find Answers

Search our DXM Forum to find answers to questions asked by other DXM users.

Ask a Question

No luck? Ask a question. Our Product and Support teams are monitoring the Forum and typically respond within 48 hours.

Ask a Question