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

templateLock: contentOnly on core/cover does nothing #66044

Closed
2 tasks done
wongjn opened this issue Oct 11, 2024 · 1 comment
Closed
2 tasks done

templateLock: contentOnly on core/cover does nothing #66044

wongjn opened this issue Oct 11, 2024 · 1 comment
Labels
[Block] Cover Affects the Cover Block - used to display content laid over a background image [Status] Duplicate Used to indicate that a current issue matches an existing one and can be closed [Type] Bug An existing feature does not function as intended

Comments

@wongjn
Copy link

wongjn commented Oct 11, 2024

Description

Applying "templateLock":"contentOnly" to a core/cover block (undersome some unknown circumstances) does not convert the block in anyway to content-only editing. It behaves as though the templateLock attribute is not set on it at all.

Step-by-step reproduction instructions

  1. Create/Edit an existing page.
  2. Enter Code Editing mode.
  3. Paste the code snippet included below.
  4. Observe no content-only editing behavior for the first cover block, but see it working for the second.

Screenshots, screen recording, code snippet

<!-- wp:cover {"url":"https://s.w.org/images/core/5.3/MtBlanc1.jpg","dimRatio":50,"customOverlayColor":"#99908e","isUserOverlayColor":true,"isDark":false,"templateLock":"contentOnly","layout":{"type":"constrained"}} -->
<div class="wp-block-cover is-light"><span aria-hidden="true" class="wp-block-cover__background has-background-dim" style="background-color:#99908e"></span><img class="wp-block-cover__image-background" alt="" src="https://s.w.org/images/core/5.3/MtBlanc1.jpg" data-object-fit="cover"/><div class="wp-block-cover__inner-container">
  <!-- wp:paragraph {"align":"center","placeholder":"Write title…","fontSize":"large"} -->
  <p class="has-text-align-center has-large-font-size">Foo</p>
  <!-- /wp:paragraph -->
</div></div>
<!-- /wp:cover -->

<!-- wp:cover {"url":"https://s.w.org/images/core/5.3/MtBlanc1.jpg","dimRatio":60,"isUserOverlayColor":true,"align":"full","style":{"spacing":{"padding":{"top":"var:preset|spacing|20","bottom":"var:preset|spacing|20","left":"var:preset|spacing|20","right":"var:preset|spacing|20"},"blockGap":"var:preset|spacing|10","margin":{"top":"0"}}},"layout":{"type":"constrained","contentSize":"78.75rem"},"templateLock":"contentOnly"} -->
<div class="wp-block-cover alignfull" style="margin-top:0;padding-top:var(--wp--preset--spacing--20);padding-right:var(--wp--preset--spacing--20);padding-bottom:var(--wp--preset--spacing--20);padding-left:var(--wp--preset--spacing--20)"><span aria-hidden="true" class="wp-block-cover__background has-background-dim-60 has-background-dim"></span><img class="wp-block-cover__image-background" alt="" src="https://s.w.org/images/core/5.3/MtBlanc1.jpg" data-object-fit="cover"/><div class="wp-block-cover__inner-container">
  <!-- wp:paragraph {"align":"center","className":"wp-block-paragraph","style":{"typography":{"fontStyle":"normal","fontWeight":"700"},"spacing":{"margin":{"top":"5rem"}}},"fontSize":"large"} -->
  <p class="has-text-align-center wp-block-paragraph has-large-font-size" style="margin-top:5rem;font-style:normal;font-weight:700">Phasellus viverra nulla ut metus varius laoreet. Suspendisse non nisl sit amet velit hendrerit rutrum. Curabitur nisi.</p>
  <!-- /wp:paragraph -->

  <!-- wp:buttons {"layout":{"type":"flex","justifyContent":"center"}} -->
  <div class="wp-block-buttons">
    <!-- wp:button {"backgroundColor":"yellow","textColor":"pink","style":{"elements":{"link":{"color":{"text":"var:preset|color|pink"}}}}} -->
    <div class="wp-block-button"><a class="wp-block-button__link has-pink-color has-yellow-background-color has-text-color has-background has-link-color wp-element-button" href="https://brigstowe.test/support-our-work/membership">Find out more</a></div>
    <!-- /wp:button -->
  </div>
  <!-- /wp:buttons -->
</div></div>
<!-- /wp:cover -->

Image

Environment info

  • WordPress 6.6.2
  • Twenty Twenty-Four 1.2
  • Chrome 129.0.6668.90 (64-bit)
  • Windows 11

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes
@wongjn wongjn added the [Type] Bug An existing feature does not function as intended label Oct 11, 2024
@talldan talldan added [Block] Cover Affects the Cover Block - used to display content laid over a background image [Status] Duplicate Used to indicate that a current issue matches an existing one and can be closed labels Oct 11, 2024
@talldan
Copy link
Contributor

talldan commented Oct 11, 2024

I'm unable to reproduce the issue with the Gutenberg plugin active.

I believe this was already fixed by #65105, which will be released in WordPress 6.7.

I'll close the issue, but let me know if it's still something you're experiencing with the plugin active and I can reopen it.

@talldan talldan closed this as not planned Won't fix, can't repro, duplicate, stale Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Cover Affects the Cover Block - used to display content laid over a background image [Status] Duplicate Used to indicate that a current issue matches an existing one and can be closed [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

2 participants