Get rid of node_page_top()

Created on 7 February 2023, almost 2 years ago
Updated 10 February 2023, almost 2 years ago

Problem/Motivation

Follow-up from 🐛 Fix hook_page_top implementation for node.module Fixed .

node_page_top() runs on every request, just in case we're on a node preview route, to add the form above the preview.

I think it ought to be possible to change the preview route to include the markup currently being added in node_page_top() - i.e. put this in the controller one way or another.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

📌 Task
Status

Active

Version

10.1

Component
Node system 

Last updated 4 days ago

No maintainer
Created by

🇬🇧United Kingdom catch

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

Comments & Activities

  • Issue created by @catch
  • 🇬🇧United Kingdom longwave UK

    Controllers return output that is wrapped into the main content block in page.html.twig. page_top is for things that get printed outside of the normal page wrapper, but maybe the main content block could bubble this up to the top level somehow?

  • 🇬🇧United Kingdom longwave UK

    I thought about this some more; we already allow ['#attached']['html_head'] to add things to <head>, so why not allow ['#attached']['page_top'] to put things in the page top?

Production build 0.71.5 2024