Environment indicator as block instead of added to page_top

Created on 17 March 2017, over 8 years ago
Updated 27 June 2025, 18 days ago

Problem/Motivation

On pages where you want to implement a sticky footer, its impossible to get it working correctly because the environment indicator is placed via the {{ page_top }} inside html.html.twig, but I'd like place it inside a custom region inside page.html.twig so that I can properly encapsulate it and get the sticky footer to stick to the bottom of short pages.

Steps to reproduce

  1. Install and configure environment indicator module.
  2. Setup a custom theme with a couple regions.
  3. In your page.html.twig file, place wrapper divs and setup a sticky footer solution.
  4. Notice that when environment indicator is installed, there is a scrollbar on short pages because env indicator bumps the page down as it sits outside the page "main content" wrapper.

Proposed resolution

Create the ability to place Environment indicator as a block in a theme region, which can be placed via page.html.twig inside the main content section.

Add logic that does NOT place Environment Indicator in page_top when it is already placed via Drupal block system.

Remaining tasks

  • Maintainer feedback.
  • Patch written.
  • Tests?
  • Reviews.

User interface changes

A new block will be available for Environment Indicator at /admin/structure/blocks

API changes

N/a

Data model changes

N/a

Original report by [PlayfulWolf]

I have a need for "Environment indicator" block, as there are cases when other modules which extend Toolbar are used or Toolbar is not used at all.

The suggestion is simple: all the functionality of env indicatro and settings available in the block. Maybe separate blocks.

Feature request
Status

Active

Version

4.0

Component

Code

Created by

🇱🇹Lithuania PlayfulWolf

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇨🇦Canada colan Toronto 🇨🇦

    Another advantage of making this available as a block is that you can decide which pages it's on.

    As it stands now, we'll be keeping it off on Prod, but would like to enable it on the contact page only so it'll be available when users submit feedback.

Production build 0.71.5 2024