Search code examples
c#asp.net-core-mvcorchardcms

How to Disable Content Field Preview on SummaryAdmin View


I have created a module (Project Module) which includes a Content Part (Project Part). The content part contains a TextField (Description). I don't want the TextField to show up on the page (Admin/Contents/ContentItems).

I set "display-type" as "Detail" to TextField in placement.json, but it didn't work. Maybe it is stupid but I've tried to add some files like "TextField-ProjectPart.SummaryAdmin.cshtml". None of them worked.

Here is my code:

https://gist.github.com/vogucore/efb0096e349591c235103e4f3f9e60d1

And some screenshots for better understanding.

Screenshot-01

Screenshot-02

I also checked out of the box Orchard modules from the source code. But couldn't find a similar case.

Could you please give me a hand on this?

Thanks a lot in advance. Peace! (;


Solution

  • I think I've found the answer. I applied the "diplay type" property as it is described in the documentation. It should've been "displayType" instead of "display-type" (so the latest documentation is incorrect. Look at "dev" instead of "latest"). When I corrected it, I got the result I was expecting.

    https://orchardcore.readthedocs.io/en/latest/OrchardCore/OrchardCore.DisplayManagement/README/

    https://orchardcore.readthedocs.io/en/dev/OrchardCore/OrchardCore.DisplayManagement/

    {
      "ProjectPart": [
        {
          "place": "Content:1"
        }
      ],
      "TextField": [
        {
          "displayType": "Detail" ,
          "place": "Content:2",
          "differentiator": "ProjectPart-Description"
        }
      ]
    }
    

    It took my hours but it's worth. I read a lot of code from the source code and learned new things.

    Peace!