I'm trying to output the alphabet where certain letters are enabled/clickable based on whether any entries from a specific section start with that letter. Here's the UI:
Getting the A-Z is easy enough:
{% set letterArray = 'A'..'Z' %}
And I'm able to get the entries by first letter:
{% set entries = craft.entries.section('myEntries').orderBy('title asc').all() %}
{% set entriesByGroup = entries|group('title[:1]') %}
{% for firstLetter, entriesInGroup in entriesByGroup %}
...
{% endfor %}
I just can't figure out how to properly merge them so I can set a class or whatever on the letters that have at least an entry.