Problem/Motivation

Adds UI blocks, dynamic rendering, and optional backend storage for managing anonymous and authenticated favourites.

Introduced a "My Favourites" block that dynamically displays selected content using JavaScript and AJAX.

Added a "Heart Icon" block for node pages, enabling users to toggle favourites via a visual and keyboard-accessible control.

  • Implemented support for anonymous users using cookie-based storage, with a configurable expiration.
  • Added a setting to toggle between cookie storage (for anonymous users) and database storage (per user uid for authenticated users).
  • Created an AJAX controller that returns published node titles from stored favourites, with revision-safe querying.
  • All frontend logic uses modern Drupal.behaviors and once() pattern, fully compatible with Drupal 10.4+ and 11.x.
  • Code gracefully handles both revisionable and non-revisionable content types.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

joseph.olstad created an issue. See original summary.

joseph.olstad’s picture

Assigned: joseph.olstad » Unassigned
Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.