Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No favicon, if sub-theme does not have a copy of the base theme favicons #1447

Open
donquixote opened this issue Apr 30, 2024 · 2 comments
Open

Comments

@donquixote
Copy link

In

The path of the favicon is in the respective sub-theme, e.g.

function oe_theme_page_attachments_alter(array &$attachments) {
  [..]
  $active_theme = \Drupal::theme()->getActiveTheme();
      [..]
      $link[0]['href'] = base_path() . $active_theme->getPath() . "/images/favicons/$component_library/favicon.ico";

This means that:

  • Every sub-theme now needs a copy of these favicons. Otherwise the favicon won't work.
  • Any custom favicon in the sub-theme is overridden, unless the sub-theme also implements hook_page_attachments_alter().
@donquixote
Copy link
Author

Thoughts for the solution:

  • By default use the icons in oe_theme, so that sub-themes don't have to copy them.
  • Provide a mechanism for sub-themes to override the favicon - unless you want to completely forbid this. Maybe detect if the directory in the sub-theme exists?

But before introducing a change like this, you should have a look at existing sub-themes.
I currently have no idea how many of them exist, and how many of them were updated to provide a copy of the favicons.

@nagyad
Copy link
Member

nagyad commented Aug 26, 2024

We are looking to address the issue in the #1492 PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants