1

Using Helixbase as a model, I see there's a base configuration called Helix.Feature.Base that establishes the data store, data provider, etc. I see the setting to turn transparent sync on or off as well. The question is, can you turn this on or off for certain configurations? For example, it's on for configurations pushing layouts/templates/settings, but off for pushing content, so any content push is done manually?

Or perhaps, rather than that, would you create two base entries? So you have Helix.Feature.Base that could be extended for transparent sync to true, and then another (call it Helix.Content.Base where transparent sync is off, and you extend that one for just content?

I'm thinking the latter as I ask this, but for clarity and confirmation, is the second option the best practice in this case?

3

Transparent Sync in Unicorn can be enabled (it is disabled in the default Unicorn configuration) adding the following configuration element to a configuration block:

<dataProviderConfiguration enableTransparentSync="true" />

In a Helix project, you probably want to enable the Transparent Sync in your base configuration and then create a new configuration that extends your base configuration where Transparent Sync is disabled.

The following example shows the base configuration (Foundation.Serialization.Base) where the Transparent Sync is enabled and the extended configuration (Foundation.Serialization.NoTransparentSync) with the transparent sync disabled.

<configuration name="Foundation.Serialization.Base" abstract="true">
  <targetDataStore physicalRootPath="$(sourceFolder)\$(layer)\$(module)\serialization" />
  <predicate type="Unicorn.Predicates.SerializationPresetPredicate, Unicorn" singleInstance="true">
  </predicate>
  <dataProviderConfiguration enableTransparentSync="true" />
  <syncConfiguration type="Unicorn.Loader.DefaultSyncConfiguration, Unicorn" singleInstance="true" updateLinkDatabase="false" updateSearchIndex="true" maxConcurrency="1" />
</configuration>

<configuration name="Foundation.Serialization.NoTransparentSync" abstract="true" extends="Foundation.Serialization.Base">
  <predicate type="Unicorn.Predicates.SerializationPresetPredicate, Unicorn" singleInstance="true">
  </predicate>
  <dataProviderConfiguration enableTransparentSync="false" />
</configuration>

Then use the extended configuration name (Foundation.Serialization.NoTransparentSync in my example) to extends the configurations where transparent sync should be enabled. For example:

<configuration name="Project.Content" extends="Foundation.Serialization.NoTransparentSync">
  <predicate type="Unicorn.Predicates.SerializationPresetPredicate, Unicorn" singleInstance="true">
     ...
     ...
  </predicate>
</configuration>
2
  • Thanks, very helpful. Is there any thoughts on using transparent sync in production, or should that be only manual? Not for content of course, but like if I was using TDS and I made a change to a template or rendering, I'd be able to override what's out there 99.9% of the time. Feb 4 '20 at 2:26
  • 1
    I personally would not use Transparent Sync in production, but instead sync Unicorn items using the remote sync process. In a typical deployment pipeline, you will first deploy your serialized items in the destination serialization folder and then invoke a remote Unicorn sync. To support rollback capabilities, when you deploy the serialized items, implement also a mechanism to delete from the destination serialization folders any items that has been deleted in your code repository. Feb 4 '20 at 2:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.