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

Embed element in RichText hidden when viewing and editing content

    Details

      Description

      Steps to reproduce

      1. Go to PlatformUI;
      2. Create a content type having a RichText field;
      3. Back to "Content Structure", create a content of the content type you just created with Rich Text field;
      4. Add an embed image to the Rich Text field
      5. Publish
      6. The Rich Text field will appear empty, but if you inspect with firebug

      <section xmlns="http://ez.no/namespaces/ezpublish5/xhtml5/edit"><div data-ezview="embed" id="yui_3_18_1_1_1445338149103_7919" data-href="ezcontent://106" data-ezelement="ezembed"></div></section>
      

        Issue Links

          Activity

          Hide
          Damien Pobel (Inactive) added a comment -

          This is the exact output of the REST API and we should add something inside that div. Now the question is, which part of the application should do that ?
          ping André Rømcke Petar Spanja Bertrand Dunogier

          Show
          Damien Pobel (Inactive) added a comment - This is the exact output of the REST API and we should add something inside that div. Now the question is, which part of the application should do that ? ping André Rømcke Petar Spanja Bertrand Dunogier
          Hide
          Bertrand Dunogier added a comment -

          That's a tough one...

          What does the REST API provide you with, as a markup language/domain ? Something meant to be edited ? If you take care of the display, I'm guessing that you would take care of putting something in the embed, but it's not that simple...

          Show
          Bertrand Dunogier added a comment - That's a tough one... What does the REST API provide you with, as a markup language/domain ? Something meant to be edited ? If you take care of the display, I'm guessing that you would take care of putting something in the embed, but it's not that simple...
          Hide
          Petar Spanja (Inactive) added a comment -

          Did we not discuss this in Lyon workshop? (I can't recall the details ATM

          Show
          Petar Spanja (Inactive) added a comment - Did we not discuss this in Lyon workshop? (I can't recall the details ATM
          Hide
          André Rømcke added a comment - - edited

          [~damien.pobel@ez.no] could you give us more context here? what is the format you expect in Editor in comparison?

          What we agreed on in the past was that content view is not a preview, it is rather more or less going to be showing a semantic view exactly like when editing (mainly w/o editing specific things).

          Show
          André Rømcke added a comment - - edited [~damien.pobel@ez.no] could you give us more context here? what is the format you expect in Editor in comparison? What we agreed on in the past was that content view is not a preview, it is rather more or less going to be showing a semantic view exactly like when editing (mainly w/o editing specific things) .
          Hide
          Damien Pobel (Inactive) added a comment - - edited

          well almost the same issue exists when editing (for the record, we use the same format) but the embed is almost visible (thanks to the "widget" CKEditor plugin) but still empty for the user so without meaning.
          André Rømcke And to answer your question, I expect the div representing the embed to have some content or an attribute I can put as content so that the end user knows which content is embed. So either:

          <div data-ezview="embed" data-href="ezcontent://106" data-ezelement="ezembed">Name of the content</div>
          

          or

          <div data-ezview="embed" data-href="ezcontent://106" data-ezelement="ezembed" data-content-name="Name of the content"></div>
          

          would work for me.

          The alternative is to load the embed content in PlatformUI (thanks to ezcontent://106) which is also possible but requires quite some work on PlatformUI side and has the downside of adding a delay before the editor can see which content is embed.

          Show
          Damien Pobel (Inactive) added a comment - - edited well almost the same issue exists when editing (for the record, we use the same format) but the embed is almost visible (thanks to the "widget" CKEditor plugin) but still empty for the user so without meaning. André Rømcke And to answer your question, I expect the div representing the embed to have some content or an attribute I can put as content so that the end user knows which content is embed. So either: < div data-ezview = "embed" data-href = "ezcontent://106" data-ezelement = "ezembed" >Name of the content</ div > or < div data-ezview = "embed" data-href = "ezcontent://106" data-ezelement = "ezembed" data-content-name = "Name of the content" ></ div > would work for me. The alternative is to load the embed content in PlatformUI (thanks to ezcontent://106) which is also possible but requires quite some work on PlatformUI side and has the downside of adding a delay before the editor can see which content is embed.
          Hide
          Petar Spanja (Inactive) added a comment -

          [~damien.pobel@ez.no] That makes it clear, I think we can add this to the Docbook->XHTML5Edit converter, making that data delivered from REST.

          Show
          Petar Spanja (Inactive) added a comment - [~damien.pobel@ez.no] That makes it clear, I think we can add this to the Docbook->XHTML5Edit converter, making that data delivered from REST.
          Hide
          Damien Pobel (Inactive) added a comment - - edited

          side note: the lack of content in the div representing the embed has also the side effect of confusing the browser if the embed element is followed by a paragraph, ie:

          <p>Before embed</p>
          <div data-ezview="embed" data-href="ezcontent://106" data-ezelement="ezembed"/>
          <p>After embed</p>
          

          is interpreted by the browser (both when viewing and editing) as:

          <p>Before embed</p>
          <div data-ezview="embed" data-href="ezcontent://106" data-ezelement="ezembed">
            <p>After embed</p>
          </div>
          

          so in the above comment the first solution would also avoid this bug.

          Show
          Damien Pobel (Inactive) added a comment - - edited side note: the lack of content in the div representing the embed has also the side effect of confusing the browser if the embed element is followed by a paragraph, ie: < p >Before embed</ p > < div data-ezview = "embed" data-href = "ezcontent://106" data-ezelement = "ezembed" /> < p >After embed</ p > is interpreted by the browser (both when viewing and editing) as: < p >Before embed</ p > < div data-ezview = "embed" data-href = "ezcontent://106" data-ezelement = "ezembed" > < p >After embed</ p > </ div > so in the above comment the first solution would also avoid this bug.
          Hide
          Petar Spanja (Inactive) added a comment -

          Ok, seems simply adding LIBXML_NOEMPTYTAG option when saving XML would solve that one.

          Show
          Petar Spanja (Inactive) added a comment - Ok, seems simply adding LIBXML_NOEMPTYTAG option when saving XML would solve that one.
          Hide
          André Rømcke added a comment - - edited

          But LIBXML_NOEMPTYTAG will mean he will get <br></br> which might cause other issues.
          Better if name is content of the div, can potentially be inside own tag (suggestions [~damien.pobel@ez.no]?) to future proof for additional meta data in the future.

          Show
          André Rømcke added a comment - - edited But LIBXML_NOEMPTYTAG will mean he will get <br></br> which might cause other issues. Better if name is content of the div, can potentially be inside own tag (suggestions [~damien.pobel@ez.no] ?) to future proof for additional meta data in the future.
          Hide
          Petar Spanja (Inactive) added a comment -

          Can the description here be updated in regard to the discussion, so that requirements of the client-side are made clear?

          Show
          Petar Spanja (Inactive) added a comment - Can the description here be updated in regard to the discussion, so that requirements of the client-side are made clear?
          Hide
          Damien Pobel (Inactive) added a comment -

          Actually, while working on adding images in the RichText editor, I figured out that this issue is a bit more complicated than just adding the content name in the embed element. Because in the case of an embed representing an image, I would need an <img> inside the embed div and/or something on the embed element saying "this embed represents an image in the editor" otherwise I have no way to discriminate an embed for image from a "normal" embed and I can not implement what is specified in https://doc.ez.no/display/PR/Online+Editor%3A+Scope (especially the custom toolbar to when giving the focus to an image).

          Show
          Damien Pobel (Inactive) added a comment - Actually, while working on adding images in the RichText editor, I figured out that this issue is a bit more complicated than just adding the content name in the embed element. Because in the case of an embed representing an image, I would need an <img> inside the embed div and/or something on the embed element saying "this embed represents an image in the editor" otherwise I have no way to discriminate an embed for image from a "normal" embed and I can not implement what is specified in https://doc.ez.no/display/PR/Online+Editor%3A+Scope (especially the custom toolbar to when giving the focus to an image).
          Hide
          Damien Pobel (Inactive) added a comment - - edited

          Without response, I choose to set the class ez-embed-type-image on the embed element representing an image in the editor in https://github.com/ezsystems/PlatformUIBundle/pull/436 (EZP-25108) but the problem of having empty embed remains.

          Show
          Damien Pobel (Inactive) added a comment - - edited Without response, I choose to set the class ez-embed-type-image on the embed element representing an image in the editor in https://github.com/ezsystems/PlatformUIBundle/pull/436 ( EZP-25108 ) but the problem of having empty embed remains.
          Show
          Damien Pobel (Inactive) added a comment - PR: https://github.com/ezsystems/PlatformUIBundle/pull/514
          Show
          Damien Pobel (Inactive) added a comment - Merged in master in Merged in master in https://github.com/ezsystems/PlatformUIBundle/commit/2f6e7da74db4472cef9ce44b5e7845c393f150aa
          Hide
          Rui Silva (Inactive) added a comment -

          Tested and approved by QA for master.

          Show
          Rui Silva (Inactive) added a comment - Tested and approved by QA for master.

            People

            • Assignee:
              Unassigned
              Reporter:
              Pedro Resende (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: