This project is not covered by Drupal’s security advisory policy.
About
Like counters tell you how many people liked something. On a
community site the more interesting question is usually who.
OGCB Likes provides a block that renders the users who liked the node you are
looking at as a compact, readable line — "Liked by Anna, Max and 3 others".
Every name links to the user profile, and the "3 others" link opens a dialog
with the complete list, rendered in whichever user view mode you configure. When
someone likes or unlikes the content, the line updates immediately without a
page reload.
The likes themselves are stored by the
Flag module. The module ships a
like_node flag as optional configuration; which content types it
applies to and who may use it stay under your control on the regular Flag
screens. OGCB Likes only handles the display side.
Features
- Names instead of numbers — a summary line of linked
usernames rather than an anonymous counter. - Full list in a dialog — the overflow link opens a native
HTMLdialogelement with every liker, rendered in a configurable
user view mode, so profile pictures and fields come along. - Live updates — liking and unliking updates the summary and
the dialog client-side, with no page reload. - Configurable per block instance — how many names appear
before they collapse into "and X others", sorting by date liked or by
username, ascending or descending, and the user view mode. - Permission aware — the block is only rendered for roles
that hold theflag like_nodepermission. - Themeable — a single Twig template with named blocks and a
documentedogcb-likes-*class namespace.
Requirements
- Drupal 11
- PHP 8.3 or newer
- Flag 5.x
Getting started
Install with composer require drupal/ogcb_likes and enable the
module. The like_node flag is created for you; open
Structure → Flags to pick the content types it applies to, and grant the
Flag Like (Node) permission to the roles that should be able to like
content. Then place the Likes block — it sits in the
Social category — on your node display via Block Layout or Layout
Builder, and set the summary limit, sorting and user view mode in the block
settings.
About the name
The module grew out of the Open Government Community Builder
(OGCB) site template, which is where the ogcb_ prefix comes
from. It has no dependency on OGCB and works on any Drupal site that uses
Flag.
Supporting organizations
Development sponsored by erdfisch.
Project information
Maintenance fixes only
Considered feature-complete by its maintainers.- Project categories: Content display, Integrations, User engagement
- Ecosystem: Flag
3 sites report using this module
- Created by atropoides on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.



