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

    Details

    • Type: Story Story
    • Status: Specification
    • Priority: High High
    • Resolution: Unresolved
    • Affects Version/s: 2.3.1
    • Fix Version/s: None
    • Component/s: Landing Page Manager
    • Labels:
      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
      

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Bertrand Dunogier
            Reporter:
            Bertrand Dunogier
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: