enonic / xp

Enonic XP
https://enonic.com
GNU General Public License v3.0
202 stars 34 forks source link

Support `allowContentType` in part descriptor #8689

Closed alansemenov closed 3 years ago

alansemenov commented 3 years ago

Add support for allowContentType fields in the part descriptor schema. If <allowContentType> is specified, this part should be available only for content types matching the specified regular expressions.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<part xmlns="urn:enonic:xp:model:1.0">
  <display-name>My cool part</display-name>
  <allowContentType>landing-page</allowContentType> // only for content type `landing-page` and...
  <allowContentType>${app}:*</allowContentType // ...for content types in this application
  <form>
  </form>
</part>
rymsha commented 3 years ago

8706 fixes it differently