3

For Sites 9.1, I have written Custom resolver for doing an action when someone Un-publish page or component.

I am deploying using Add-on server. My package consists of .dll and manifest file.

Sharing manifest file content that takes care of page scenario(using itemType:

Tridion.ContentManager.CommunicationManagement.Page) and Component scenario separately (using itemType:Tridion.ContentManager.ContentManagement.Component) for Components.

However, I am not able to modify manifest.json correctly for both page and component itemType together.

What would be the configuration update in manifest.json to cover both Page & Component?

manifest.json file content:

{
  "manifestVersion": "1.0",
  "version": "1.0.0.0",
  "id": "AssetUnpublish",
  "name": "AssetUnpublish",
  "author": "SDL developers",
  "description": "Custom Resolver",
  "minVersion": "0.0.0.0",
  "maxVersion": "15.0.0.0",
  "requireConfiguration": "No",
  "extensions": [
    {
      "type": "CMResolver",
      "name": "AssetUnpublish",
      "supportedVersions": "0.0.0.0",
      "properties": {
        "itemType": "Tridion.ContentManager.CommunicationManagement.Page",
        "type": "CustomAssetResolver.MyResolver",
        "assemblyFileSource": "CustomAssetResolver.dll"
      }
    }
  ]
}
2

2 Answers 2

8

manifest.json file allows multiple extensions, so you could add resolvers for both Component and Page as separate entries.

For example:

manifest.json file with multiple extentions:

        "extensions": [
           {
          "type": "CMResolver",
          "name": "AssetUnpublish",
          "supportedVersions": "0.0.0.0",
          "properties": {
            "itemType": "Tridion.ContentManager.CommunicationManagement.Page",
            "type": "CustomAssetResolver.MyResolver",
            "assemblyFileSource": "CustomAssetResolver.dll"      
          },
          {
            "type": "CMResolver",
            "name": "ComponentPublishResolver",
            "supportedVersions": "0.0.0.0",
            "properties": {
              "itemType": "Tridion.ContentManager.ContentManagement.Component",
              "type": "CustomAssetResolver.MyComponentPublishingResolver",
              "assemblyFileSource": "CustomAssetResolver.dll"
            }
          }
        ]
2
  • 1
    Thank you @shahid .. I tried this option and it works well :) Feb 2, 2021 at 11:39
  • 1
    @Mohan Happy to help, happy coding Feb 2, 2021 at 11:49
0

Sharing working copy of my manifest.json with little modification :

{
  "manifestVersion": "1.0",
  "version": "1.0.0.0",
  "id": "AssetUnpublish",
  "name": "AssetUnpublish",
  "author": "SDL developers",
  "description": "Custom Resolver",
  "minVersion": "0.0.0.0",
  "maxVersion": "15.0.0.0",
  "requireConfiguration": "No",
  "extensions": [
    {
      "type": "CMResolver",
      "name": "AssetUnpublish",
      "supportedVersions": "0.0.0.0",
      "properties": {
        "itemType": "Tridion.ContentManager.CommunicationManagement.Page",
        "type": "CustomAssetResolver.MyResolver",
        "assemblyFileSource": "CustomAssetResolver.dll"
      }
     },
      {
        "type": "CMResolver",
        "name": "ComponentPublishResolver",
        "supportedVersions": "0.0.0.0",
        "properties": {
          "itemType": "Tridion.ContentManager.ContentManagement.Component",
          "type": "CustomAssetResolver.MyResolver",
          "assemblyFileSource": "CustomAssetResolver.dll"
        }
     }
  ]
}


    

2
  • 2
    Good to see your full config, but please accept the @Shahid Eqamuddin answer.
    – Velmurugan
    Feb 2, 2021 at 13:56
  • @velu - Thanks for pointing out. Done :) Feb 8, 2021 at 17:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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