surevelox / OrchardCore.Modules

Modules for Orchard Core CMS
https://surevelox.github.io/OrchardCore.Modules/
BSD 3-Clause "New" or "Revised" License
19 stars 4 forks source link

Defining ContentType for display in DevicePreview #56

Closed patrikvolka closed 1 year ago

patrikvolka commented 1 year ago

Hello, is there a way to define which content types DevicePreview is used for and which not?

Example, I have two content types: ContentType "A" - I want to use DevicePreview ContentType "B" - I don't want to use DevicePreview

Thank you for your help.

ns8482e commented 1 year ago

There is in-built support - the module depends on orchard core's OOTB ContentPreview preview action shape.

DevicePreview is rendered if there is Preview button shape available. You can hide preview shape using placement and that won't show DevicePreview for that content type as below

{
  "ContentPreview_Button": [
    {
      "place": "-",
      "contentType": [ "ContentTypeB" ]
    }
  ]
}
patrikvolka commented 1 year ago

Thanks