Home

Awesome

SitecoreCopyPageToVersions

  1. Management Summary
  2. Installation
  3. Assembly references and dependencies
  4. Configuration
  5. Usage
  6. Dependent items and components
  7. Security
  8. Performance

Management Summary

Copy Page To Versions is an extension for the Content Editor and the Experience Editor. It provides a dialog for content editors, where a page in a specific version can be copied to a selectable list of language versions. This includes all datasources referenced on the page renderings.

The Current version is tested on Sitecore 9.0.1

Installation

The module is available as Sitecore package for the Package Installer or as NuGet package.

Via item package

To install Copy Page To Versions perform the following steps:

The package ships with:

If you only need the Sitecore items there you can also just install the following package:

Via NuGet package

Assembly references and dependencies

All assemblies referenced by Namics.Common.Packages.CopyPageToVersions.dll, are shiped with a common Sitecore installation. The assembly is compiled against the following assembly references:

AssemblyVersion
Newtonsoft.Json10.0.3
Sitecore.Kernel11.1.0.0
Sitecore.Mvc2.1.0.0
Sitecore.Speak.Applications2.1.0.0
Sitecore.Speak.Client3.1.0.0
System.Web.Http.WebHost5.2.3.0
System.Web.Mvc5.2.3.0

Configuration

The whitelisting of translatable templates is taken from the "Copy Page To Versions Configuration" under /sitecore/system/Modules/Copy Page To Versions/Copy Page To Versions Configuration.

Image of CopyPageToVersions Configuration

Field NameField TypeDescription
Filter Whitelisted TemplatesCheckboxChoose whether to filter/include the selected templates for the item creation, or not.
Template WhitelistTreelistOnly the selected templates are included for the version creation, if the "Filter Whitelisted Templates"-Checkbox is checked.

Usage

A user is able to copy a page in a specific version to a selectable list of language versions form experience editor and content editor. Therefore open the Copy Page To Versions dialog via the provided buttons: Image of CopyPageToVersions button in Content Editor Image of CopyPageToVersions button in Experience Editor In the content editor, the button is only enabled, if the selected item is a content item and has a defined layout.

Copy Page To Versions Dialog

Image of CopyPageToVersions Dialog

Dialog InputDescription
Create only versions without copying field valuesIf this checkbox is selected, only the language versions of all related page items get created and the final renderings are merged to the target language versions. This can be useful, if you only want to create all page related item versions without field values, i.e. manual translation from English to German, where you don't want the english content on the german versions.
Do not create versions for related itemsIf checked, only the langage versions of the page item get created and the final renderings get copied to the target language versions. This can be useful, if you only want to create page versions and copy the final renderings.
Force copy field values (this will overwrite already existing field values)If checked, all field values are getting overwritten with the source language field values. This means, if a version of a selected target language already exists, with different/modified field values, they got lost. Default behaviour is, that fields, with already exitsting content are not getting overwritten. Only use this flag, if you're absolutely sure that you'll overwrite existing versions with the field values from the source lanugage.
Source LanguageSource Language of the translation. The current language of the page in the Experience Editor is selected per default. If you manually change it, make sure, the current page in this source language exists.
Target LanguageTarget Languages of the translation. If the Languages root is selected, the translation will be requested for all languages (except source language).
Final ConfirmationThis flag needs to be set as final confirmation, that the Copy-Button gets enabled

Dependent items and components

Sitecore Items

The following Sitecore items are needed

DatabaseItemDescription
core/sitecore/client/Applications/Dialogs/CopyPageToVersionsDialog*The dialog
core/sitecore/client/Applications/ExperienceEditor/Pipelines/User Defined/CopyPageToVersions*The dialog pipelines
core/sitecore/client/Business Component Library/version 1/Layouts/Renderings/Resources/Rule/Rules/Actions/CopyPageToVersionsThe rule action for the copy button
core/sitecore/content/Applications/WebEdit/Ribbons/WebEdit/Versions/Copy*The webedit ribbon button for the experience editor
core/sitecore/content/Applications/Content Editor/Ribbons/Chunks/Copy Page To Versions Chunk* <br> /sitecore/content/Applications/Content Editor/Ribbons/Strips/Versions/Copy*The custom chunk and button in the versions ribbon in content editor
master/sitecore/system/Modules/Copy Page To VersionsThe configuration item for the template whitelisting
master/sitecore/templates/User Defined/Copy Page To VersionsThe template for the configuration

Code Files

The following JavaScript files are needed for the dialog

NamePathDescription
CopyPageToVersions.js\sitecore modules\Web\CopyPageToVersions\Commands\CopyPageToVersions.jsHandles the button command. Defines canExecute and executes the CopyPageToVersionsPipeline
CopyPageToVersionsDialog.js\sitecore modules\Web\CopyPageToVersions\Dialogs\CopyPageToVersionsDialog.jsDialog JS tho handle events in the dialog. i.e. checking a selection and show message bar
CopyPageToVersions.OpenDialog.js\sitecore modules\Web\CopyPageToVersions\Pipelines\CopyPageToVersions.OpenDialog.jsPipeline JS which opens the dialog
CopyPageToVersions.js\sitecore\shell\client\Speak\Layouts\Renderings\Resources\Rules\ConditionsAndActions\Actions\CopyPageToVersions.jsRule Action which is registered on the Copy-Button. Handles the dialog submission and calls the CopyPageToVersionsController with the submission data

Security

CopyPageToVersionsController checks if a user is authenticated and only runs the processor if current context is master.

Performance

The copy process runs in a pipeline context. To copy an average page to 10 languages takes about 500ms Information about the elapsed time during a copy process can be viewed in the logfile, i.e. "CopyPageToVersionsProcessor: ended in 00:00:00.5277924"