- Issue created by @mrupsidown
- Status changed to Closed: works as designed
10 months ago 11:37am 8 February 2024
I create a very simple view named "Slider" with view mode "Bootstrap Carousel" as a block (or page, same behavior).
I display the block in "Content" region.
I check and everything works as expected.
Now I cd to modules/contrib/views_bootstrap/templates and copy the views-bootstrap-carousel.html.twig
I paste the file to my theme folder (I use Radix 8.x-4.13 for Bootstrap 4) templates/views folder and rename it accordingly (views-view--slider.html.twig) then clear the caches.
The template from my theme is in use but the view appears empty.
If I do a {{ dump(rows) }}
in the module template file (not in my override in my theme), this is what I get:
Now if I do the same {{ dump(rows) }}
in my theme copied template, this is what I get:
This is the HTML produced by the template file from my theme:
<div id="slider" class="carousel " data-interval="" data-pause="false">
<div class="carousel-inner">
<div class="carousel-item active">
</div>
</div>
</div>
Obviously, the template doesn't print the rows correctly since the rows array is totally different.
The same seems to happen with the Cards view mode. Haven't tried others but I have Grid view templates in a project that uses the same module version and same Drupal version that work without any issue.
Closed: works as designed
4.4
Carousel