Jumoo / uSync.Complete.Issues

Public Issue tracker and roadmap for uSync.Complete
https://jumoo.co.uk/usync/complete/
2 stars 1 forks source link

Can't exclude content by type #203

Closed ttdac closed 1 year ago

ttdac commented 1 year ago

Describe the bug I need to exclude content data type from sync and can't make it work. I already tried Exclude and ExcludeContentTypes options from appsettings.json.

Version (please complete the following information):

To Reproduce I only need to use Snapshots and Publisher.

  "uSync": {
    "Settings": {
      "ExportOnSave": "None",
      "DisableDashboard": true
    },
    "Sets": {
      "Default": {
        "DisabledHandlers": [ "DomainHandler" ],
        "Handlers": {
          "PublishedContentHandler": {
            "Settings": {
              "Exclude": "Brand 1/Settings/Site Configuration", // I tried both options
              "ExcludeContentTypes": "siteConfig" // I tried both options
            }
          }
        }
      }
    },
    "Publisher": {
      "Settings": {
        "IncomingEnabled": true,
        "OutgoingEnabled": false,
        "AppId": "MY_APP_ID",
        "AppKey": "MY_APP_KEY"
      }
    }
  }

Expected behavior Exclude the content doc type siteConfig I'm using on this project from sync.

KevinJump commented 1 year ago

Hi,

The Publisher stuff, is in a slightly different location. uSync:Publisher:Handlers.

Its also worth noting that while all these settings are theoretically possible, its not something we fully support, in general it should work, but you might find that you get false positives in that usync reports changes that are not changes because things are missing.

Note we have extra DisabledHandlers because internally uSync will add the content handlers to disabled, but once you choose to set the list of disabled handlers, uSync will no longer do that, and if you don't disable the content one then for content saved values will be pushed and published, vs the Published values which is the default value.

"uSync": {
    "Publisher": {
      "Handlers": {
        "DisabledHandlers": [ "ContentHandler", "ContentTemplateHandler", "DomainHandler" ],
        "Handlers": {
          "PublishedContentHandler": {
            "Settings": {
              "RulesOnExport": true,
              "Exclude": "Path/To/Exclude",
              "ExcludeContentTypes": "siteConfig"
            }
          }
        }
      }
    }
  }
ttdac commented 1 year ago

Many thanks, it is working now! FYI I couldn't find these options on the docs.