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

Editor: Blocks set to Sticky don't work in Template Parts #64089

Closed
2 tasks done
kspilarski opened this issue Jul 30, 2024 · 1 comment
Closed
2 tasks done

Editor: Blocks set to Sticky don't work in Template Parts #64089

kspilarski opened this issue Jul 30, 2024 · 1 comment
Labels
[Block] Template Part Affects the Template Parts Block [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 [Type] Enhancement A suggestion for improvement.

Comments

@kspilarski
Copy link

Description

Setting a block to Sticky does not work if the block is included in a Template part.

Step-by-step reproduction instructions

  1. Go to the Site Editor.
  2. Add a template part like the Header.
  3. In the list view, expand the Header (template part), then set any block under it to sticky and save.

Screenshots, screen recording, code snippet

Under the Header template part is the "Header" block which is set to sticky:

Screenshot 2024-07-30 at 11 52 25

Scrolling down the front page doesn't make the Header stay put., even it was set to sticky.


But when a block is not included in a template part, setting the block to sticky works fine:
Screenshot 2024-07-30 at 11 56 20

Environment info

  • WordPress 6.6.1, Gutenberg 18.8.0
  • Twenty Twenty Four theme
  • Chrome 126, MacOS 14.6

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
@kspilarski kspilarski added [Type] Bug An existing feature does not function as intended [Type] Enhancement A suggestion for improvement. [Block] Template Part Affects the Template Parts Block labels Jul 30, 2024
@carolinan
Copy link
Contributor

Hi!
This is issue has already been reported, so I am closing it as a duplicate. You can continue the discussions and follow the explorations here:
#56147
#47043

Meanwhile, there is a trick that you can use, and that is to add a new group at the top of the template, make it sticky, and place the template part in the group instead.

@carolinan carolinan added the [Status] Duplicate Used to indicate that a current issue matches an existing one and can be closed label Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Template Part Affects the Template Parts Block [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 [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

2 participants