PHPackages                             heimrichhannot/contao-likes-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. heimrichhannot/contao-likes-bundle

ActiveContao-bundle[Utility &amp; Helpers](/categories/utility)

heimrichhannot/contao-likes-bundle
==================================

Put like/dislike buttons on anything in Contao CMS.

0.1.5(9mo ago)1196[1 issues](https://github.com/heimrichhannot/contao-likes-bundle/issues)LGPL-3.0-or-laterPHPPHP ^8.2

Since Jun 17Pushed 9mo agoCompare

[ Source](https://github.com/heimrichhannot/contao-likes-bundle)[ Packagist](https://packagist.org/packages/heimrichhannot/contao-likes-bundle)[ RSS](/packages/heimrichhannot-contao-likes-bundle/feed)WikiDiscussions trunk Synced 1mo ago

READMEChangelog (6)Dependencies (19)Versions (7)Used By (0)

Contao Likes Bundle
===================

[](#contao-likes-bundle)

**Slap a like button on anything in Contao.**

This Contao CMS bundle allows you to add like and dislike buttons to any (twig) template, liking or disliking whatever you please to your heart's content.

Features
--------

[](#features)

- Add like and dislike buttons to any template, attached to anything you want, e.g. models or your grandma's favorite knitting patterns
- Cookie-less/session-less association of likes and dislikes to individual user-agents using a tiny anonymous fingerprint
- Presumably GDPR-compliant, as no personal data is stored
- Extensive base template included
- Accessible with translatable title and aria-label attributes
- Rate Limiting to prevent abuse
- CSRF protected API endpoint

Installation
------------

[](#installation)

You can install this bundle using Composer:

```
composer require heimrichhannot/contao-likes-bundle
```

Then update your database and you're good to go.

Usage
-----

[](#usage)

To add a like button to your template, include a like &amp; dislike button template and pass options as `likes`, preferably created by calling `huh_likes()` with a ***namespace*** and a ***target*** (these can be literally any strings you like to reference this likeable thing).

```
{{ include('@Contao/huh_likes/buttons.html.twig', { likes: huh_likes('knitting-pattern', 'honeycomb-lace') }) }}
```

### On the Matter of liking Models

[](#on-the-matter-of-liking-models)

Most commonly, you will want to add a like button to something related to contao models, like a news article or a calendar event. In this case, we recommend using the model's **table name as namespace** and the **model's ID as target**. Or, even better, if you have access to the **`\Contao\Model` instance** directly in your template, just pass it in.

Table and IDModel Instance`huh_likes('tl_news', 42)``huh_likes(model)`### The Dislike Button and other Options

[](#the-dislike-button-and-other-options)

In the provided default template, the dislike button is NOT shown by default. If you want to show it, pass more options to the `huh_likes()` function:

```
huh_likes(model, null, {
    likes_enabled: true,
    dislikes_enabled: true,
})
```

### Accessing Likes and Dislikes

[](#accessing-likes-and-dislikes)

By using the `huh_likes()` function, you will get an object with the following getters available:

- `namespace` (`string`): The namespace you provided
- `target` (`string`): The target you provided
- `voted` (`int`): The number of votes the current user has cast on this target (typically 0, 1, or -1)
- `likes` (`int`): The total number of likes
- `dislikes` (`int`): The total number of dislikes
- `likesEnabled` (`bool`): Whether likes are enabled
- `dislikesEnabled` (`bool`): Whether dislikes are enabled

Customization
-------------

[](#customization)

Within the default template [`@Contao/huh_likes/buttons.html.twig`](contao/templates/huh_likes/buttons.html.twig), you will find four blocks that you can override with your custom icons:

- `icon_like_neutral`
- `icon_like_set`
- `icon_dislike_neutral`
- `icon_dislike_set`

With these blocks, you can easily replace the default icons with your own SVGs or any other HTML content.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~7 days

Total

6

Last Release

299d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/28ad3224d8727b622ebd229840eea6b9dbcb83eb0bd609e6ce65b614830ff538?d=identicon)[digitales@heimrich-hannot.de](/maintainers/digitales@heimrich-hannot.de)

---

Top Contributors

[![ericges](https://avatars.githubusercontent.com/u/25957923?v=4)](https://github.com/ericges "ericges (25 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/heimrichhannot-contao-likes-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/heimrichhannot-contao-likes-bundle/health.svg)](https://phpackages.com/packages/heimrichhannot-contao-likes-bundle)
```

###  Alternatives

[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)[codefog/contao-haste

haste extension for Contao Open Source CMS

42650.8k139](/packages/codefog-contao-haste)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
