New Sitecore Module: Layout Modes Comparer

Geschrieben von Maks Ponomarenko veröffentlich am in der Kategorie Sitecore
The module highlights the difference between Sitecore Final and Shared Layouts and allows to reset the specific component, changed in the final layout.

Part 1: Overview

Hey,

If you read this blog Post, you’ve probably found that you can’t reset the specific component, changed in the final layout.

As you know, final and shared layouts are just normal Sitecore fields in the layout section of the item.

 

Sitecore Layout Modes Comparer

 

So if you want to reset your changes in the final layout, you can reset whole final layouts field:

 

Sitecore Layout Modes Comparer 

 

To understand the problem, let’s imagine that you work as a Content Editor with a big multi-language project. And now you realize, that you’ve just deleted or edited some component in a wrong language. How to fix it? Resetting the final layout is not an option, because there can be other components, created on this final layout by you or another member of your team. And now you have no other options besides creating this component again.

And this is just one of the cases happening often in each team. And I don’t need to remind anyone how much time and money it costs.

As a solution, I’ve created a new Sitecore Module “Layout Modes Comparer”. This module highlights each component, created/updated/deleted in the Final Layout. And what is even more important, it allows to reset your final layout changes per COMPONENT:

https://marketplace.sitecore.net/Modules/L/Layout_Modes_Comparer.aspx

 

Now let’s take a look at the features of the module:

 

  • The changes are shown in the Sitecore Message:

Click Presentation in shared and final layout to see the information about each change on the final layout. In the final layout it is shown in a red message. And don’t worry, it is not an error, it is just to draw attention to the fact that it is another mode.

 

 

  • Highlight the changed components:

In the shared layout the module highlights the components updated or deleted on the final:

Red – deleted; Yellow - updated

 

 

 

  • In the final layout it highlights the created or updated components:

Blue – created and yellow as usual 😊

 

  • ToolTips show detailed information about every component’s changes:
    1. changed datasource item
    2. the components properties, updated in the final layout
    3. if your component is moved into another placeholder

 

 

  • And of course, with this ExperienceEdit Button “Undo Components Changes” you can reset the specific component, changed in the final layout.

 

Sitecore Layout Modes Comparer Abstract Spot

 

 

Notice: The final layout is configured for each language and version separately. It means that the module will show and reset only the changes of the current version on the current language.

Also, this module compares the final with shared layouts, and not the final layout with its standard values.

 

 

Part 2 : How to Install and Configure the module

 

How to Install, activate and configure this module

 

  1. Install the module:

You can find the Layout Modes Comparer on the Sitecore MarketPlace: https://marketplace.sitecore.net/Modules/L/Layout_Modes_Comparer.aspx

When you download it, you will get a Sitecore Package that can be installed with the Sitecore Package Installer:

 

 

  1. Activate the module:
  • The module extends the “SelectLayout” logic. That’s why the first step is to go to the folder “sitecore\shell\client\Sitecore\ExperienceEditor\Commands”, to deactivate the Sitecore “SelectLayout.js” file and to activate the “SelectLayout.js_layoutModesComparer” (deleting the suffix “_layoutModesComparer”).

 

Sitecore Layout Modes Comparer

 

 

Now the module is ready to compare the shared and final layouts:

 

 Sitecore Layout Modes Comparer

 

 

  • Next step is to activate the most helpful feature, that allows to reset the components changes, you’ve made in the final layout:

 

Sitecore Layout Modes Comparer

 

 

To do it, please assign the Experience Edit button “Undo Components Changes” on the components or on the base renderings template (selecting the button in the /sitecore/templates/System/Layout/Sections/Rendering Options/__Standard Values)

 

 

 

 

  1. The module settings:

The changed components are highlighted with different colors:

  • blue – new component
  • red – deleted
  • yellow – updated

The colors can be configured in the Core DB in the configuration Item “/sitecore/system/Modules/Layout Modes Comparer/Color Settings”

 

 

 

 

Now your “Layout Modes Comparer” is ready to work. Enjoy 😊