After publishing my last article about copying property values to other language versions, I received constructive feedback on how could I change the script. In this article I would like to describe changes that will improve the way the add-on works.
The previous version had some significant limitations:
- it was not possible to change a value that was copied to other language versions – the Editor only ticked a checkbox and specified that the value should be copied. This could lead to overwriting a property with an incorrect value.
- when updating a property, a new version of the content was created, but not published. This caused the Editor to have to go into each version and publish it anyway which still requires some time.
With last changes in code the Editor now has the ability to edit the property value and publish the content directly from the dialog.
Thanks to this, the Editor can check what the previous property value was, whether property was set at all and what it will be replaced with. In addition, the edited value can be overwritten, which makes it easier to update all language versions with different values.
Additionally, next to each property editor, there is a “Publish on save” checkbox so that we can publish selected versions.
The code is available as a gist. It has to be copied to the site and added as an initialization module.