Tag Icons working with tag groups

As long as this feature is not available, I have found a workaround that allows me to configure the icons for all tags in a tag group more quickly. I use Data Explorer to generate a string, which I then simply paste into the settings field of the component.

The query I use to generate the configuration:

--[params]
-- string :tag_group_name
-- string :icon
-- string :color

WITH selected_group AS (
  SELECT id FROM tag_groups WHERE name = :tag_group_name
),
tag_ids AS (
  SELECT tag_id
  FROM tag_group_memberships
  WHERE tag_group_id = (SELECT id FROM selected_group)
),
tag_names AS (
  SELECT name
  FROM tags
  WHERE id IN (SELECT tag_id FROM tag_ids)
)
SELECT string_agg(name || ',' || :icon || ',' || :color, '|') AS tag_icon_config
FROM tag_names
4 Mi Piace