Problem/Motivation
Drupal 7 had a site logo token. Drupal 8+ has none. Site builders and module developers can't put the site logo into blocks, emails or other token-enabled text without custom code.
The original core issue went through a lot of iterations, but ended up not being accepted unfortunately, so we moved it here.
Proposed resolution
Add these tokens under the existing site type, with no new top-level token type:
[site:logo] <img> tag for the active theme's logo
[site:logo:active-theme] same as [site:logo]
[site:logo:default-theme] <img> tag for the default theme's logo
[site:logo:theme-THEME] <img> tag for that installed theme's logo
[site:logo:…:url] absolute URL of the logo
[site:logo:…:url:absolute] absolute URL of the logo
[site:logo:…:url:relative] relative URL of the logo
… stands for active-theme, default-theme or theme-THEME.
Remaining tasks
User interface changes
API changes
Data model changes
Comments
Comment #3
grevil commentedDone, please review!
Note, that I moved the original core implementation with the help of Claude Code.
Comment #4
csakiistvanComment #5
csakiistvan✅ Tested and works — applied MR !143, rebuilt caches and set the global Metatag defaults to
title: [current-page:title] | [site:logo:active-theme:url:relative]andimage_src: [site:logo:active-theme:url]: /user/login now shows "Log in | /core/themes/olivero/logo.svg" in the browser tab and<link rel="image_src" href="https://tester.ddev.site/core/themes/olivero/logo.svg" />in the source, where before the fix the tokens stayed unreplaced. The logo tokens work in a real token consumer.Notes
[site:logo:url]and[site:logo:url:relative]stay unreplaced, while[site:logo]works; the issue title mentions:url, so it may be worth either supporting them or clarifying that a theme selector is required.logo.use_default: falsewith an empty path),[site:logo]renders an empty string.Comment #6
csakiistvan