Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-29762

Add a content type validator to the embed block attribute type

    XMLWordPrintable

Details

    • Icon: Story Story
    • Resolution: Unresolved
    • Icon: High High
    • None
    • 2.3.1
    • Landing Page Manager
    • None

    Description

      It should be possible to set which content type(s) are valid for an embed attribute.

      Example based on EE demo:

      • places.contentId should only contain place_list items
      • hero.image should only contain image items

      The validator's configuration should be used to restrict the type(s) accepted by the UDW, and to validate the block.

      Syntax suggestion

              places:
                  name: Places
                  category: default
                  thumbnail: '/bundles/ezplatformadminui/img/ez-icons.svg#places'
                  views:
                      default: { name: 'Default block layout', template: '@ezdesign/blocks/places.html.twig' }
                  attributes:
                      contentId:
                          name: Places
                          type: embed
                          validators:
                              not_blank:
                                  message: You must provide value
                              regexp:
                                  options:
                                      pattern: '/[0-9]+/'
                              content_type:
                                  options:
                                      type: place_list
                                  message: Choose a Place List item
      

      Attachments

        Activity

          People

            bertrand.dunogier@ibexa.co Bertrand Dunogier
            bertrand.dunogier@ibexa.co Bertrand Dunogier
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: