Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fragment block should retain authored classes and render all authored sections #409

Open
ujjwal5 opened this issue Oct 4, 2024 · 0 comments · May be fixed by #410
Open

Fragment block should retain authored classes and render all authored sections #409

ujjwal5 opened this issue Oct 4, 2024 · 0 comments · May be fixed by #410

Comments

@ujjwal5
Copy link

ujjwal5 commented Oct 4, 2024

Expected Behaviour

  • The classes defined for a fragment block (in documents) should be retained when the fragment block is rendered.
  • All sections defined inside a fragment should be rendered.

Actual Behaviour

  • The classes defined for the fragment block are not retained.
  • Only the first section is rendered when multiple sections are defined in the fragment.

Reproduce Scenario (including but not limited to)

Steps to Reproduce

Scenario 1: Classes defined for the fragment block are not retained.

  • Include a fragment in a document and define specific classes for the fragment block.
  • Add CSS for the defined class.
  • Preview or publish the page. When the page is rendered, the CSS class is not applied because the class is missing from the HTML DOM.

Scenario 2: Only the first section is rendered when multiple sections are defined in a fragment.

  • Include a fragment block in a document.
  • Add a link to another document containing the fragment content.
  • Define multiple sections within this linked document.
  • Preview or publish both documents. Only the first section of the fragment content is rendered.

HTML changes

The HTML structure of the fragment block differs from other blocks. Typically, the structure follows: container → wrapper → block. However, for the fragment block, it only includes container → wrapper, omitting the block level.

With this update, classes defined in the referred fragment section, which was previously copied into the fragment block section, will remain in the referred fragment section. Further, all the referred fragment sections will now be copied under the fragment block, ensuring the same HTML DOM standards as other blocks.

Platform and Version

Verified with latest bolierplate code.

Sample Code that illustrates the problem

The problem is caused by this code section: https://github.com/adobe/aem-boilerplate/blob/main/blocks/fragment/fragment.js#L49-L52

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant