Regular Drupal comment sorting
Comment sticked on top
Comment sticked on top by likes

The Comment on top module pins one top-level comment, together with its replies, to the top of a node's comment list.

3.x uses Drupal's default comment list. You do not need a Views block, and you should not hide the Comments field. The current stable release is still 2.0.3, which uses the older Views setup below.

Features

Drupal's default comment order is by date. This module lets you pin one favorite top-level comment above the others. Replies stay with their parent; they cannot be pinned on their own.

On a node with comments, roles with permission see "Stick on top" under each top-level comment, and "Remove from top" on the pinned one.

The submodule Comment on top by likes can pin the most liked top-level comment automatically (likes minus dislikes), using the Like/Dislike module.

Post-installation (3.x)

See the README: 3.0.x README.

  • Requires the core Comment module and a Comments field left enabled in Manage display.
  • On Drupal 11.4 Standard, create a content type, a comment type, and a Comments field first.
  • Grant "Administer Comment on top" at /admin/people/permissions/module/comment_on_top.
  • Optionally disable the feature for some comment types at /admin/config/content/comment-on-top.
  • Use "Stick on top" / "Remove from top" on a node with comments.

For likes pinning, enable the submodule, add a Like/Dislike field to the comment type, then enable comment types at /admin/config/content/comment-on-top/by-likes (or per node under Comment settings).

A theme may override the pinned comment with comment--pinned-on-top.html.twig.

Uninstallation (3.x)

Uninstall Comment on top by likes first if it is enabled, then Comment on top, at /admin/modules/uninstall. You do not need to remove a Views block or restore the Comments field.

Project information

Releases