Search code examples
localizationc1-cms

Composite C1 console edit button available for non translated data


We are using Composite C1 version 2.1.1 with static C# data. This data is localizable (ILocalizedControlled) and is shown on top of the data tree (TreeDefinitions\GlobalData.xml). Users are able to translate the data to their selected language, but somehow it is possible to "Edit" the data before translating it. This means that when they do it wrong (i.e. in stead of first choosing "Translate Data" and then "Edit", choose "Edit" directly) translated data will appear on the source language site. Which is very annoying because the source data is lost as well. Seems that when choosing a data item only "Translate Data" should be possible, but now four buttons are shown (Translate Data, Edit, Add and Delete). So I would like to be able to change this behavior, but can't seem to find where or how to influence this.

Hope anyone can help.


Solution

  • somehow it is possible to "Edit" the data before translating it.

    This is because in your tree definition (TreeDefinitions\GlobalData.xml), you explicitly use EditDataAction, which does what it is supposed to do: allow editing an item using the standard edit workflow.

    I suggest that instead, you create and use a custom workflow for editing items, which might have a logic to allow editing only if the data item is translated in the current language.

    I don't have a ready-to-use code for that but you can check samples for custom workflows here.

    Also, in the upcoming version 4.1 of Composite C1 (currently beta), you don't need to create tree definitions for static data types. They are available in the C1 Console out of the box. And you can add, edit and delete items of these types there, and the Translation feature on localized types works as expected.

    Compare:

    The item exposed via a Tree Definition (the issue you mentioned)

    enter image description here

    And the same item available under "Static Datatypes" (a new feature in 4.1)

    enter image description here