Problem/Motivation
Spun off from this request for Drupal 7 (token module): #823780: Add site logo token, where a token for the logo and logo-url have been proposed. However, since all site:*
tokens are in core, I feel this belongs to core as well. Therefore I am proposing it here for Drupal 8.
Proposed resolution
The new tokens are [site:logo]
and [site:logo-url]
and they provide a rendered image and a local path respectively. In addition to that, both tokens also take a theme parameter ([site:logo:?]
, [site:logo-url:?]
) to fetch a logo for a specific theme.
Steps to reproduce:
- without applying patch, install and enable 'token' module (so you can easily browse the list of available tokens)
- edit Article content type, go to manage fields, edit Body
- click "Browse available tokens" link underneath Help text, to open Available tokens popup
- verify no site logo tokens in the Site information list
- now apply patch
- drush cr
- reload Available tokens popup, verify [site:logo] and [site:logo-url] added
- insert them into help text and create or edit an article to verify the Drupal logo and standard URL (/core/themes/bartik/logo.svg) are now visible
- configure a different logo for another theme (seven)
- insert [site:logo:seven] and [site:logo-url:seven] to have the logo show up.
- [site:logo:non-existing-theme] should not be replaced
Remaining tasks
Review.
Resolve #2855653: FilterHtmlImageSecure filters out valid local svg images so the default logo's work as well (user uploaded png/jpg files already work).
User interface changes
None.
API changes
None.
Data model changes
None.