Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

Add missing comments block to page template #127

Merged

Conversation

audrasjb
Copy link
Contributor

Description

Twenty Twenty-Two must support comments on Page post type, if enabled on a specific page using the "discussion" settings:
Capture d’écran 2021-10-18 à 10 26 39

We simply need to add the comment block template to the page.html template.

Screenshots

Before the PR: a Page with comment option enabled didn't show any comment/comment form.
Capture d’écran 2021-10-18 à 10 27 02

After the PR: comments/comment form is displayed when the option is enabled.
Capture d’écran 2021-10-18 à 10 35 52

Testing Instructions

  1. Enable comments on a Page using the "Discussion" settings of this specific page.
  2. On front-end, check wether the comments list/comment form is displayed.

@audrasjb
Copy link
Contributor Author

Please note that of course most of people don't want the sentence "Comments are closed." to be displayed at the bottom of each page since comments are closed by default for Pages.

Therefore, I'm going to open a Trac ticket to provide a filter to remove this sentence. Then, the deactivation of this sentence by default for pages will be possible on Gutenberg side. I'll take care of opening the Trac ticket, then the Gutenberg PR.

Anyway, I believe we need to implement this PR, since the Page comments core feature is currently broken on TT2.

@audrasjb
Copy link
Contributor Author

Ticket opened on Trac: https://core.trac.wordpress.org/ticket/54283

@kjellr
Copy link
Collaborator

kjellr commented Oct 22, 2021

I hope you don't mind — I took a few minutes to bring this up to date with the changes from #136. I think it's ready for a last review, it should be good to merge assuming we get a resolution to the related Gutenberg issue.

When testing this, note that the spacing isn't entirely consistent depending on whether or not comments are turned on. I opened a PR in Gutenberg to fix this: WordPress/gutenberg#35887

@kjellr kjellr added this to the Beta 1 milestone Oct 22, 2021
@audrasjb
Copy link
Contributor Author

Looks great to me @kjellr 👍

Copy link
Collaborator

@jffng jffng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @audrasjb @kjellr ! I think we can bring this in and assume WordPress/gutenberg#35732 will get addressed as the PR to make it work is quite small.

@kjellr kjellr merged commit 9ebc24c into WordPress:trunk Oct 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants