2

In Drupal 7, there used to be a checkbox: "Allow comment title". Unchecking that, and there was no comment title.

I am unable to locate a similar setting in Drupal 9.

I've found: How to remove or hide the Subject field for comments?

It explains how to auto-generate the subject field for a comment. This is not what I am asking. I don't want to display any subject field when showing a comment. If you're familiar with how comments work in issues posted on Drupal.org, that is the solution I am looking for.

Edit: In comments, it is suggested that you can do this by navigating to the "Manage display" tab for the comment type. However, this is a screen dump (Drupal 9.4.8) of that tab for the default comment type:

Manage display

I see no obvious way to set the title not to be shown.

4
  • 1
    Can't you hide the subject field on the Manage Display tab? Nov 9, 2022 at 0:26
  • That's how you do it. Admin -> Structure -> Comment types -> [COMMENT TYPE] -> manage display. Set the title to not be shown.
    – Jaypan
    Nov 9, 2022 at 0:42
  • @PatrickKenny, no you can't you hide the subject field on the Manage Display tab. See edited question. Nov 10, 2022 at 12:17
  • @Jaypan see edited question. Nov 10, 2022 at 12:17

2 Answers 2

3

A solution is to copy core's comment.html.twig and put it in your theme's /templates folder and remove the <h3{{ title_attributes }}>{{ title }}</h3> line.

1
  • I agree that this will work, but I really do not want to create a subtheme just to be able to hide the Subject. I would prefer to do this from the administrative GUI. The contributed extension named Manage display let me do that, so I've added that as a self-answer. Nov 19, 2022 at 17:24
3

If one installs the contributed extension named Manage display the "Subject" field becomes exposed under the "Manage display" tab for a comment. You can then move it to the "Disabled" section to hide it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.