Sticky header is not working Fixed header.

Created on 29 January 2024, 5 months ago
Updated 30 January 2024, 5 months ago

Problem/Motivation

I need to make the header sticky with a fixed header. Please suggest how to do it.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Closed: won't fix

Version

1.0

Component

Code

Created by

🇮🇳India keshav.k

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

Comments & Activities

  • Issue created by @keshav.k
  • 🇫🇷France lazzyvn paris

    there is another issue, but they confirm that it works
    https://www.drupal.org/project/bootstrap_table/issues/3378593 🐛 Sticky headers not working Fixed

  • Status changed to Closed: won't fix 5 months ago
  • 🇮🇳India keshav.k

    The solution is to add the hook to your custom theme and add the offset from the top accordingly.

    /**
     * Implements hook_preprocess_views_view_bootstraptable().
     */
    function template_preprocess_views_view_bootstraptable(&$variables) {
      $view = $variables['view'];
      $style = $view->style_plugin;
      $options = $style->options;
      if ($options["extension"]['sticky_header'] == 1) {
        if (\Drupal::currentUser()->hasPermission('access toolbar')) {
          // Set the Header offset from the top.
          $variables["attributes"]['data-sticky-header-offset-y'] = 80;
        }
      }
    }
    
Production build 0.69.0 2024