gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

.editor-styles-wrapper .has-global-padding not working when using post-content block in template part

Open s56bouya opened this issue 3 years ago • 9 comments

Description

Hi.

As the title says, the left/right padding in the editor is not applied when using a post-content block with a template part.

When template parts are not used, the left/right padding is applied.

How can I apply the left/right padding even when using a template part?

Best regards.

Step-by-step reproduction instructions

  1. Create template "/templates/singular.html"(code snippet)
  2. Create a template part "/parts/main-singular.html"(code snippet)

Screenshots, screen recording, code snippet

Work

/templates/singular.html

<!-- wp:template-part {"slug":"header","tagName":"header"} /-->
<!-- wp:post-content {"layout":{"type":"constrained"}} /-->
<!-- wp:template-part {"slug":"footer","tagName":"footer"} /-->

スクリーンショット 2023-02-11 11 55 15

Not work

/templates/singular.html

<!-- wp:template-part {"slug":"header","tagName":"header"} /-->
<!-- wp:template-part {"slug":"main-singular","tagName":"main"} /-->
<!-- wp:template-part {"slug":"footer","tagName":"footer"} /-->

/parts/main-singular.html

<!-- wp:post-content {"layout":{"type":"constrained"}} /-->

スクリーンショット 2023-02-11 11 54 42

Environment info

  • WP 6.1
  • Twenty Twenty-Three 1.0 and other theme.

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

s56bouya avatar Feb 11 '23 03:02 s56bouya

Hi @s56bouya, thanks for reporting. I just tested with the latest version of Gutenberg (15.1) and the Twenty Twenty-Three theme, and I am not able to replicate this issue. I also tested with WordPress 6.2 Beta 2 and everything worked as expected.

Would you be able to retest with either Gutenberg or Beta 2 and see if the issue is resolved on your end? Thanks!

ndiego avatar Feb 21 '23 14:02 ndiego

Hi @s56bouya, this issue came up again in today's Editor Bug Scrub. Have you had a chance to test with the latest version of Gutenberg or WordPress 6.2 Beta 3? I am still no able to replicate on my end.

ndiego avatar Feb 28 '23 14:02 ndiego

HI @ndiego ,Sorry for the late response. I tried with wp 6.2 beta-3 and was able to reproduced.

When reproducing with Twenty Twenty Thirteen, I was missing the steps to delete or rename single.html and page.html and not load the templates, but only the singular.html template.

Is it possible to check reproduction again?

s56bouya avatar Mar 01 '23 02:03 s56bouya

Help us move this issue forward. This issue is being marked stale since it has no activity after 15 days of requesting more information. Please add info requested so we can help move the issue forward. Note: The triage policy is to close stale issues that need more info and no response after 2 weeks.

github-actions[bot] avatar Mar 17 '23 00:03 github-actions[bot]

I'm having the same problem. If I don't put "wp:post-content" directly in the single.html file in templates, but through a template part, has-global-padding is not added to the div of .is-root-container only in the block editor. It is added to the front and site editors. Not fixed in Gutenberg 15.9.1

iidastudio avatar Jun 02 '23 15:06 iidastudio

Hmm, it shouldn't be too hard to reproduce.Reproduction is not difficult.

s56bouya avatar Jun 05 '23 01:06 s56bouya

Thanks for the feedback @iidastudio and @s56bouya. We will review in tomorrow's Editor Bug Scrub, and see what we can do to move this issue towards a resolution.

ndiego avatar Jun 05 '23 12:06 ndiego

Help us move this issue forward. This issue is being marked stale since it has no activity after 15 days of requesting more information. Please add info requested so we can help move the issue forward. Note: The triage policy is to close stale issues that need more info and no response after 2 weeks.

github-actions[bot] avatar Jun 21 '23 00:06 github-actions[bot]

Reproduction Report

Description

❌ This report can't validate the issue reproduction

Environment

  • WordPress: 6.9-alpha-60459
  • PHP: 8.2.29
  • Server: Apache/2.4.62 (Debian)
  • Database: mysqli (Server: 11.8.2-MariaDB-ubu2404 / Client: mysqlnd 8.2.29)
  • Browser: Chrome 138.0.0.0
  • OS: Windows 10/11
  • Theme: Twenty Twenty-Three 1.6
  • MU Plugins: None activated
  • Plugins:
    • Gutenberg 21.2.0
    • Test Reports 1.2.0

Testing Instructions

  1. I've followed OP instructions and the ones provided here
  2. ❌ Paddings are displayed as expected

Actual Results

  1. ❌ Error condition is not occurring

Additional Notes

  • It seems that this issue has been stalling for so long because it's not reproducible. Maybe it has been solved already in certain patch. I would advise in this case to close as worksforme and in case any of the authors happen to find a clear method to reproduce this, then I would suggest commenting here and pinging me for further testing.
  • Needs Testing can be removed also

cc @karmatosed

Supplemental Artifacts

Through a template part: template-part

Directly template

SirLouen avatar Jul 17 '25 11:07 SirLouen