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

Use url attr to get the url of the media used by cover block #750

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from

Conversation

matiasbenedetto
Copy link
Contributor

@matiasbenedetto matiasbenedetto commented Nov 27, 2024

What?

  • Updates how the linked media gets from the core/cover block.
  • Add a test case for cover blocks using background images.

Why?

Fixes #748

How?

It no longer parses the block's HTML but relies on its' URL' attribute.

Testing instructions:

  • Add a cover block in a template using the site editor with an image from the media library.
  • Enable the 'Fixed background' or 'Repeated background' option in the cover block styles sidebar.
  • Save the changes in the editor.
  • Save the theme using CBT with the 'Localize Images' option enabled.
  • Check the code of core convert in the resulting pattern. It should reference an image from the theme with a relative URL, not the media library URL.

@matiasbenedetto matiasbenedetto changed the title Update/cover block media Use url attr to get the url of the media used by cover block Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

Fails to localise background image in Cover block with fixed or repeat background
1 participant