Uploaded image for project: 'Ibexa IBX'
  1. Ibexa IBX
  2. IBX-6077

Custom classes and attributes on table in RichText Online Editor are not saved

    XMLWordPrintable

Details

    • Yes

    Description

      When using custom data attributes and classes on tables, the information provided in the editor is not saved.

      Here is a sample config:

      ibexa:
          system:
              admin_group:
                  fieldtypes:
                      ezrichtext:
                          attributes:
                              table:
                                  t-custom-attribute:
                                      type: boolean
                                      default_value: false
                                  t-another-attribute:
                                      type: choice
                                      choices: [attr1, attr2]
                                      default_value: attr2
                                      required: false
                                      multiple: true
      
                              paragraph:
                                  p-custom-attribute:
                                      type: boolean
                                      default_value: false
                                  p-another-attribute:
                                      type: choice
                                      choices: [attr1, attr2]
                                      default_value: attr2
                                      required: false
                                      multiple: true
      
                          classes:
                              table:
                                  choices: [t-regular, t-special, t-tip_box, t-warning_box]
                                  default_value: t-regular
                                  required: false
                                  multiple: false
      
                              paragraph:
                                  choices: [p-regular, p-special, p-tip_box, p-warning_box]
                                  default_value: p-regular
                                  required: false
                                  multiple: false
      

      Editing an article I have set the defined classes and attributes on both a table and a paragraph.

      This is what the editor sends to the backend

      <?xml version="1.0"?>
      <!DOCTYPE section [
      <!ENTITY nbsp "&#160;">
      (....)
      <!ENTITY diams "&#9830;">
      ]>
      <section xmlns="http://ibexa.co/namespaces/ezpublish5/xhtml5/edit">
         <p class="p-special" data-ezattribute-p-custom-attribute="true" data-ezattribute-p-another-attribute="attr2,attr1">sdf V8</p>
         <figure class="table t-special" data-ezattribute-t-custom-attribute="true" data-ezattribute-t-another-attribute="attr2,attr1">
            <table>
               <tbody>
                  <tr>
                     <td> </td>
                     <td> </td>
                  </tr>
                  <tr>
                     <td> </td>
                     <td> </td>
                  </tr>
                  <tr>
                     <td> </td>
                     <td> </td>
                  </tr>
                  <tr>
                     <td> </td>
                     <td> </td>
                  </tr>
               </tbody>
            </table>
         </figure>
      </section>
      

      And this is the converted richtext

      <?xml version="1.0" encoding="UTF-8"?>
      <section xmlns="http://docbook.org/ns/docbook" xmlns:ezcustom="http://ibexa.co/xmlns/dxp/docbook/custom" xmlns:ezxhtml="http://ibexa.co/xmlns/dxp/docbook/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0-variant ezpublish-1.0">
         <para ezxhtml:class="p-special">
            <ezattribute>
               <ezvalue key="p-custom-attribute">true</ezvalue>
               <ezvalue key="p-another-attribute">attr2,attr1</ezvalue>
            </ezattribute>
            sdf V8
         </para>
         <informaltable>
            <tbody>
               <tr>
                  <td> </td>
                  <td> </td>
               </tr>
               <tr>
                  <td> </td>
                  <td> </td>
               </tr>
               <tr>
                  <td> </td>
                  <td> </td>
               </tr>
               <tr>
                  <td> </td>
                  <td> </td>
               </tr>
            </tbody>
         </informaltable>
      </section>
      

      As you can see, the classes and attributes set on table are not included in the xslt transformation

      Designs

        Attachments

          Activity

            People

              Unassigned Unassigned
              vidar.langseid@ibexa.co Vidar Langseid
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: