2

I'm trying to serialize a parent folder as CreateAndUpdate but the descendants as CreateOnly.

I found a similar question (Sitecore Content Serialization to include parent item as create only) but the question and answer both split the includes into separate objects in the JSON file... I'd like to avoid this if possible as I don't want to screw up the existing file structure...

I've set my include/rules as follows:

    {
      "name": "dictonary",
      "path": "/sitecore/content/Dictionary",
      "scope": "ItemAndDescendants",
      "allowedPushOperations": "CreateAndUpdate",
      "rules": [
        {
          "path": "*",
          "scope": "DescendantsOnly",
          "allowedPushOperations": "CreateOnly"
        }
      ]
    }

Will the DescendantsOnly rule override the CreateAndUpdate allowedPushOperation from it's parent?

If not, is there a way to achieve this without splitting the include up in to separate items?

Cheers,

Dan

1 Answer 1

1

Replace DescendantsOnly with ItemAndDescendants inside rules like that:

  {
  "name": "dictonary",
  "path": "/sitecore/content/Dictionary",
  "scope": "ItemAndDescendants",
  "allowedPushOperations": "CreateAndUpdate",
  "rules": [
    {
      "path": "*",
      "scope": "ItemAndDescendants",
      "allowedPushOperations": "CreateOnly"
    }
  ]
}

With this config, Dictionary item will be always updated and all descendants of Dictionary will be only created and never updated

1
  • Thanks for your help Marek!
    – Daniel
    Feb 4, 2022 at 15:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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