Allow other modules to hook into <head>

Created on 13 February 2024, 10 months ago
Updated 16 February 2024, 10 months ago

Problem/Motivation

Features like ✨ Provide option to include canonical URL links Fixed are solvable by other modules in the eco system. The challenge here is that Printable has used a custom html template stripping out all the capabilities that Drupal has of manipulating HEAD, JS, or CSS. I get it, this is by design because you don't want that stuff cluttering up the printer friendly version of content.

However, it also means that we have to reinvent the wheel, AND that no customizations can be implemented without being added directly to the template itself.

For SEO purposes, it's extremely important that we have the ability to add metatags, but for that module to work, we must have the ability to alter the head.

Proposed resolution

I propose we add the original values for preprocessing Drupal's HEAD back into the template so that a metatag impelemtation can be used via metatag_routes, hook_metatags_alter(), or some custom module that may come to handle printable's metatags explicitly.

At MVP if the above isn't achievable is canonical and/or robots metatags such as noindex.

Remaining tasks

User interface changes

API changes

Data model changes

✨ Feature request
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States generalredneck

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @generalredneck
  • πŸ‡¦πŸ‡ΊAustralia nigelcunningham Geelong

    I agree.

    I'm planning on implementing a plugin / event based way of altering the content. The link extractor is currently a prime target and modifications like this would fit in well to such a rework.

    Hopefully not far away, though I'm checking through the issue queue for other ideas before starting on this.

Production build 0.71.5 2024