Skip to main content
Version: v15.x - Umbraco 15

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

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

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

Handler Sets

A handler set defines the behaviour of a group of handlers. uSync and the uSync dashboard already use a set called 'default' automatically. You can create your own sets, but you will need to build it in code.

Enabled

Is this handler set enabled?

HandlerGroups

List of groups handlers can belong to.

DisabledHandlers

List of disabled handlers.

IsSelectable

Is this handler selectable? For handlers to appear in the drop down on the dashboard, they have to be selectable.

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

Enabled

Turns a handler on or off.

Actions

What actions the handlers will work for.

UseFlatStructure

Saves the files in a single folder or use a folder structure to represent the layout in Umbraco.

GuidNames

Items should be saved with their guid/key value as the filename.

FailOnMissingParent

If 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

Override the group the handler belongs to.

CreateClean

Create a corresponding _clean file for this export. This clean file will only be created if the item in question has children.

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" : "",
}
}
}
}
}

CreateOnly

Items are created if they do not exist, but existing items are not synced.

IgnoreAliases

List of aliases of items that you don't want the handler to import.

Handler Specific Settings

Some handlers have additional settings

Content/Media

Path to a content item include.  

Exclude

Path to a content item to exclude.  

ImportTrashed

Import items that are in the Trashed state.  

ExportTrashed

Export items that are in the Trashed state.  

RulesOnExport

Run the rules during an export.  

DoNotSerialize

Names of content/media properties not to serialize as part of a sync.
(Added uSync 9.1+ #289)  

IncludeContentTypes

List 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

List 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))

DataTypes

List of datatypes by name that you don't want to import the configuration for.  |

NoConfigEditors

List 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 different name.