Skip to main content
Version: v9.x - Umbraco 9

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 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.

appsettings.json
"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.

appsettings.json
"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.
Settings{}{}See 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.
DataTypesNoConfigNamesStringList of datatypes by name that you don't want to import the configuration for.
-NoConfigEditorsStringList 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"
}
}
}
}
}
}