All Collections
Importing and exporting content | Integrations
Sitecore integration
Sitecore Integration - Importing FAQs (Frequently Asked Questions)
Sitecore Integration - Importing FAQs (Frequently Asked Questions)

Customising your media items import, support for multiple languages import, metadata import and converting internal links.

Bruno Wilson avatar
Written by Bruno Wilson
Updated over a week ago

How can I customise my media items imported into Sitecore?

All files from the attachment field types mapped to corresponding fields in Sitecore are imported into the Sitecore Media Library. The default location for all such items is /sitecore/media library/Gather Content/. Under the Content Workflow media folder, all items are structured in the following way ///. If a mapped field has a specified data source, all files will be imported to that location.

The plugin architecture is extensible and the logic of uploading items can be overridden. A new class should be created that inherits the IMediaRepository interface:

<code>namespace GatherContent.Connector.IRepositories.Interfaces
{
public interface IMediaRepository<T>: IRepository where T: class
{    
T UploadFile(string targetPath, File fileInfo);
string ResolveMediaPath(CmsItem item, T createdItem, CmsField field);
}
}</code>

ResolveMediaPath method should implement logic on resolving media path. Media path can be a path to media folder in Sitecore or to any other storage (drive, could service etc.)

UploadFile method defines how the importing file will be uploaded to that storage.

After the new class is developed, it should be registered in the Dependency Injection configuration file, which is

<code>/App_Config/GatherContent.Connector.Repositories.config</code>

Find MediaRepository component and replace current type to newly created on:

<code><component>
id="MediaRepository"
lifestyle="Transient" service="GatherContent.Connector.IRepositories.Interfaces.IMediaRepository`1
[[Sitecore.Data.Items.Item, Sitecore.Kernel]],
GatherContent.Connector.IRepositories"
type="<namespace>.<new class name>, <assembly name>">

</component></code>

How does the integration support multiple languages?

It's possible to import content from Content Workflow in multiple languages in Sitecore. Content Workflow most commonly supports multiple languages via separate tabs within an item as shown below.

Setting up the template mappings

In order to import all language versions into a single item in Sitecore, a mapping should be specified for each language version (so for each separate tab).

Follow the steps to set up your tab template mapping as described in Step 2: Template Mappings.

Importing the content

1. Navigate to the item (node) in the Sitecore tree that the new items should be imported to, and click 'Import' in the top bar

2. Select the Content Workflow project to import your content from
An import content dialog will appear showing an empty grid. At this stage, you can select any Content Workflow project with a mapped template. You can also filter items by Content Workflow workflow status and Template.

3. Select the items you want to migrate
Select the items you'd like to import using the checkboxes and then click the 'Next' button. This will launch the confirmation screen.

4. Specify the language, destination and select the items' status
On the confirmation screen, it's possible to specify which language in Sitecore all items will be imported to and which mappings to use.

For example, to import English content from Content Workflow into the English version in Sitecore, set 'English' as the Language.

5. Start the import
Clicking the 'Import' button will start the import process. The process can take some time depending on the number of items being imported.

6. Once the import is complete, repeat this process for each language version (each tab)
As soon as content from one language version has been imported, the next version can be imported in the same destination folder but with different configurations.

7. View the results
As a result, we will get multilingual items in Sitecore.

How does the integration support importing metadata?

If there is any metadata attached to an item in Content Workflow, it can be imported to Sitecore as well. This process is the same as the method for importing from different tabs (shown directly above).

1. Add metadata fields

You should add metadata fields to your Content Workflow Templates Just like any other fields that you want to be mapped and copied during the import process.

2. Map fields
If the metadata content is independent of a specific language within a multilingual project, it should be mapped only once in any language-specific mapping. Otherwise, metadata fields should be mapped for every language independently as any other content.

How do I convert internal Content Workflow item links into Sitecore links?

You can convert your Content Workflow item links into Sitecore links using our integration.

All hyperlinks within rich text content pointing to internal content items in Content Workflow can be converted (expanded) into Sitecore links during or after your import. In order for the integration to convert your Content Workflow links, your URLs must always be in the following format (the format of an item link):

<code>https://$tenant-name$.gathercontent.com/item/$item-ID$</code>

Links can be expanded either during the import process by checking "Expand Content Workflow Links" checkbox:

Or after the import by selecting a content node pressing Expand Links button on the Content Workflow ribbon. 

In both cases, the system will scan all rich text fields within the selected sub-tree and convert Content Workflow links to corresponding Sitecore links. The system will be able to convert a link if the referring item has been imported to Sitecore as well and that item has a Presentation layer.

How long does the import take?

This depends on the number of items you’ve selected for import. The number and size of attachments will also impact the import time.

Does the integration support import to a date field?

It is possible to store a date in a regular text field within Content Workflow and import that into Sitecore in date format (Date or DateTime field types).

Did this answer your question?