Problem/Motivation
The carousel template contains markup and attributes that do not follow Bootstrap 5’s carousel structure:
- Navigation and indicators can be rendered when there is only one slide.
- `data-wrap` is used instead of `data-bs-wrap`.
- The configured keyboard option is not rendered.
- Controls use Bootstrap 4-style links instead of buttons.
- Indicator numbers are derived from result keys instead of slide numbers, producing incorrect labels in multi-column carousels.
- The active indicator lacks `aria-current="true"`.
- Drupal wrapper attributes are not rendered.
- The carousel preprocess adds unrelated media-object classes.
Steps to reproduce
1. Create a View using the Bootstrap carousel format.
2. Enable navigation and indicators.
3. Configure multiple columns per slide.
4. Configure the keyboard or wrap options.
5. Inspect the resulting markup.
6. Repeat with no more results than fit on one slide.
Proposed resolution
Calculate the slide count during preprocessing using the result count and configured column count. Pass the slide count and keyboard option to Twig, and update the template to follow Bootstrap 5’s documented markup.
Comments
Comment #3
shelane