Resolve #3506809 "Support metadata field in Acquia DAM Asset Library."

Closes #3506809

Summary

Adds a generic Views field plugin allowing site builders to display any DAM metadata field in the Asset Library through Views UI configuration - no code required.

What's New

  • Generic field plugin with display_key selector for any metadata field
  • Smart formatting for text, arrays, and dates
  • Comprehensive options: separators, wrappers, limits, max length, date formats
  • Performance boost: 24h cached field discovery (~99% fewer API calls)
  • Clean UI: Vertical stacking in grid, consistent labels, auto-hide empty

Technical Highlights

  • Path fix: asset['metadata']['fields'][key] (nested structure)
  • Type safety: Cast sanitizeValue() to string for return types
  • isEmpty() override: Proper empty detection for hide_empty
  • Data providers: Reduced test duplication

Files

  • Added: MetadataField.php, acquia-dam-views.css, MetadataFieldTest.php
  • Modified: Trait (caching), filters (DI), hooks, views.inc, libraries, README

Usage

Views UI → Add field → "DAM Metadata Field" → Select field → Configure → Save

Edited by Pravin Gaikwad

Merge request reports

Loading
Loading