Favorites (Bookmarks) Official
v1.0.1
Universal bookmarks for any content. Heart button in cards, profile panel, toggle API.
Favorites — Bookmarks
Universal bookmarks for any content in apidcms. Heart button in cards, profile panel, toggle API.
Features
- Heart button toggle for any content type
- Works with entity_relations for flexible binding
- User favorites panel in profile
- REST toggle API for AJAX
- Count display on item cards
Dependencies
- account — required for user binding
Installation
- Copy the
favorites/folder into your project'splugins/ - Admin panel: Plugins → Favorites → Activate
- Add the heart button to your Twig templates
Twig
{# Heart toggle button #}
<button class="fav-toggle" data-item-id="{{ item.id }}" data-table="products">
{% if is_favorited(item.id, 'products') %}❤️{% else %}🤍{% endif %}
</button>
{# User favorites page #}
<a href="/favorites">My Favorites ({{ fav_count() }})</a>
License
MIT