Skip to main content
Version: v10.x - Umbraco 10

Handlers

In uSync a Handler manages the reading and writing of the uSync Settings from the folder of the Umbraco installation.

Handlers don't do the actual importing or exporting of items that work is done by the Serializers.

Handler Groups

note

In uSync v9 and v10 handlers are enabled in the default group by default generally you do not need to add handlers individually to the config:

The most common action is to Turn Content On or Off, this can be done with the ExportAtSave option: see our guide on turning off content edition.

Disable Individual Handlers

If you want to turn individual handlers off you can add them to the list of Disabled Handlers.

"uSync" : {
"Sets" :{
"Default" : {
"DisabledHandlers" : ["DictionaryHandler"]
}
}
}

Handler Defaults

All handlers have their own settings, which you can set individually (see below). You can set default settings for all the handlers in the config.

"uSync": {
"Sets" : {
"Default" : {
"HandlerDefaults" :{
"Enabled": true,
"Actions": "All",
"UseFlatStructure": true,
"FailOnMissingParent": false,
"Group": "",
"Settings": {
// handler specific settings go here
}
}
}
}
}
KeyDefaultValuesNote
EnabledTrueTrue/FalseTurns a handler on or off.
ActionsAll"All", "Import", "Export", "Report"What actions the handlers will work for.
UseFlatStructureTrueTrue/FalseSaves the files in a single folder or use a folder structure to represent the layout in Umbraco.
FailOnMissingParentFalseTrue/FalseIf set to true the import will fail if the parent item cannot be found. If set to false the import process will attempt to find the closest possible parent item and import the item into that location.
Group"""", "Settings", "Content"Override the group the handler belongs to.
SettingsSee handler specific settings below.

Handler settings

Handler settings allow you to have more control over the behaviour of a handler. There are a number of settings all handlers share, and some that only work for certain handlers.

appsettings.json
"uSync": {
"Sets" : {
"Default" : {
"HandlerDefaults" :{
"Settings": {
"CreateOnly": false,
"IgnoreAliases" : "",
}
}
}
}
}

KeyValuesNote
CreateOnlyTrue/FalseItems are created if they do not exist, but existing items are not synced.
IgnoreAliasesStringList of aliases of items you don't want the handler to import.

Handler Specific Settings

Some handlers have additional settings

HandlerKeyDefaultValueNote
Content/MediaInclude""Content PathPath to a content item include.
 Exclude""Content Pathpath to a content item to exclude.
 ImportTrashedtrueTrue/FalseImport items that are in the Trashed state.
 ExportTrashedtrueTrue/FalseExport items that are in the Trashed state.
 RulesOnExportFalseTrue / FalseRun the rules during an export.
 DoNotSerialize""PropertyNameNames of content/media properties not to serialize as part of a sync
(Added uSync 9.1+ #289)
 IncludeContentTypes""ContentTypesList of content types to include, when this value is set ONLY these content types will be included in any sync
(Added uSync 10.3+ #419))
 ExcludeContentTypes""ContentTypesList of content types to exclude, When using this setting all other content types are synced and any in this list are ignored.
(Added uSync 10.3+ #419))
DataTypesNoConfigNames""StringList of datatypes by name that you don't want to import the configuration for.
 NoConfigEditors""StringList of editor aliases of items you don't want the configuration to be imported for.

Example

These settings are often set on individual handlers for example, the configuration below would not import trashed items, and exclude any content in the the Home/Testing content tree.

appsettings.json
"uSync" :{
"Sets": {
"Default": {
"Handlers": {
"ContentHandler" : {
"Settings" : {
"ImportTrashed": false,
"Exclude": "Home/Testing"
}
}
}
}
}
}
tip

uSync.Publisher - uses a diffrent content handler called PublishedContentHandler if you want settings to apply to only that handler you need to use the diffrent name.