Add a possibility to set <body> tag classes per variant

Created on 25 January 2017, almost 8 years ago
Updated 14 August 2024, 5 months ago

It would be great to have an option to set classes for <body> tag in variant settings.

Feature request
Status

Needs work

Version

1.0

Component

User interface

Created by

🇷🇺Russia kpv

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

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

  • 🇷🇴Romania zoltanb

    Hi

    After updating to Drupal core 9.5.9+ an issue appeared with Page Manager - "Path has unnecessary query appended." ( https://www.drupal.org/project/page_manager/issues/3362561 🐛 Path has unnecessary query appended. Fixed ). We applied the latest patch from there, but after that the body classes are not applying anymore to the pages.

    I updated the patch #26 with slight changes:

    1. use key _page_manager_page_variant instead of page_manager_page_variant
    2. use \Drupal::request() instead of \Drupal::routeMatch() (because parameter is not available there anymore)

    Now it is working again. See diffs in https://www.drupal.org/project/page_manager/issues/3362561 🐛 Path has unnecessary query appended. Fixed for more details.

  • Status changed to Needs work 5 months ago
  • 🇩🇪Germany Anybody Porta Westfalica

    Could someone please turn this into a MR for future work?

  • 🇬🇧United Kingdom 3li U.K. 🇬🇧
  • 🇬🇧United Kingdom 3li U.K. 🇬🇧

    3li changed the visibility of the branch 2846878-add-class-to-body to hidden.

  • 🇬🇧United Kingdom 3li U.K. 🇬🇧

    3li changed the visibility of the branch 2846878-add-class-to-body to active.

  • Merge request !36Creating MR of #2846878 → (Open) created by 3li
  • 🇬🇧United Kingdom 3li U.K. 🇬🇧
  • Pipeline finished with Success
    3 months ago
    Total: 294s
    #290568
Production build 0.71.5 2024