How to import two culture versions of a document using Import Toolkit

   —   
This article describes how to import two culture versions of a document using Import Toolkit. This functionality was added in the hotfix 26 for version 6.0. 
First of all you need to apply hotfix 26 or later. Make sure that you apply the fix in the Setup files  as well. See the screenshot below:



The import of two or more cultures has two steps:

1. Import the first culture. It is a standard procedure and you can follow the instructions in our documentation. Please take a look at the See also section at the bottom for more details. Make sure that you configure the document culture in Step 6, for example set the value to en-US for the English version of the document. In other words, in this first step you should import only en-US documents.

2. After you have successfully imported the first culture version of the document, you can start the import again and now please make sure that in Step 2 of the wizard you select the option ‘Import new and overwrite existing document’. This option is a must if you would like to create a new culture of the same document and not to create a new one in the second culture. Now you can go through the wizard. The most interesting part is in Step 6; you will need to dynamically configure the NodeID row to make sure that the correct node will be updated, i.e. a new culture version will be created for this node. The option to configure this field is:

#<target>SELECT TOP 1 NodeID FROM View_CMS_Tree_Joined WHERE NodeAliasPath ='{%NodeAliasPath%}'

Here is an explanation:
- <target>: the NodeId will be selected from the target database, i.e. we will find which node will be updated. You cannot read this information from the source database because the NodeID is generated automatically and is different from the source one.

- ‘{%NodeAliasPath%}’: is a parameter based on which we can find appropriate data. It is a connection between the source data and the first document culture in the target database. In this case, NodeAliasPath was the same in the source and the target database. This means that this information could be used to find the appropriate NodeID in the target database and correct node was updated. In the next step you should see the NodeID correctly resolved. This way, you can make sure that the correct node will definitely be updated and your condition is working.

Note: To understand how this works, it  is useful to know the difference between node and document data. There is always 1 node (with one nodeID) which has multiple documents related to it (one for each culture). Therefore to create a new document culture, you need to know the NodeID for which this culture version will be created.
-it-
 

See also: Import Tooklit

Applies to: Kentico CMS 6.x
Share this article on   LinkedIn