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

embed template for data attributes and classes doesn't expose class in the template

    XMLWordPrintable

Details

    Description

      Following the doc] description to override embed template for embed elements using custom class and attributes doesn't work like expected. The warning explains that data attributes and classes are exposed automatically to the target template. data attributes are exposed but class unfortunately not.

      Below is a dump from an override embed template:

      array:17 [▼
        "content" => Content {#58322 ▶}
        "location" => Location {#58476 ▶}
        "objectParameters" => array:1 [▶]
        "data_attributes" => array:2 [▼
          "caption" => "true"
          "fade-duration" => "2"
        ]

      The class is only exposed in : EzPlatformRichTextBundle:RichText/embed:content.html.twig  and this template] is adding an additional div outside the template that should be later overridden and including data attributes as well.

      To be reviewed in doc:

      Instead, you can make use of the data_attributes and class properties in your templates.

      Expected behavior:

      • custom class and attributes should be only exposed to embed, embed-inline, embed-image templates

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            ramzi.arfaoui-obsolete@ez.no Ramzi Arfaoui (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: