Impossible to configure the container classes

Created on 9 March 2021, almost 4 years ago
Updated 13 December 2023, about 1 year ago

Problem/Motivation

I am not using Bootstrap but this module is very well thought and adapt to basically any framework. You even say it in the description of the module.

Any theme that utilizes the Bootstrap (or alike) framework grid system and classes.

But I have one issue, I looked through the code and I don't think the classes for the containers are configurable.

    $container_types = [
      'container' => $this->t('Boxed'),
      'container-fluid' => $this->t('Full'),
      'w-100' => $this->t('Edge to Edge'),
    ];
    
      // Then when saving.
      $this->configuration['container'] = $form_state->getValue(array_merge($layout_tab, ['container_type']));

      // Then using the config to build the layout.
      $theme_wrappers = [
        'blb_container' => [
          '#attributes' => [
            'class' => [$this->configuration['container']],
          ],
        ],
        'blb_container_wrapper' => [
          '#attributes' => [
            'class' => [],
          ],
        ],
      ];

The keys seems to be used directly as classes when building the layout and are defined directly in the code. It would be nice to able to configure them in a form.

Steps to reproduce

Proposed resolution

Solution 1:
Add the classes in one of the settings form of the module. That's the easy solution but not very dynamic since I think it is strictly limited to 3 values.

Solution 2:
Maybe create a new tab " Container type" in the settings to be able to add dynamically the container types with a class, a name and an icon (for the admin interface).

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Active

Version

2.0

Component

Code

Created by

🇨🇦Canada phjou Vancouver 🇨🇦 🇪🇺

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.

Production build 0.71.5 2024