I have a bootstrap
sub-theme, and would like to render some of my blocks using Bootstrap's Panels components, so that the block would need to be wrapped something like this:
<div class="panel panel-default">
<div class="panel-heading">
{{ header }}
</div>
<div class="panel-body">
{{ content }}
</div>
</div>
So far I've tried to implement this via the following series of dirty hacks:
- Setting the
css-class
setting on the advanced settings of the view topanel panel-default
- wrapping the header of the view in a
<div class="panel-heading">
block - setting the
row-class
parameter in the settings of the view's unformatted list format topanel-body
This almost works, but isn't quite right:
The issue is that the resulting classes aren't nested correctly:
If I manually modify the classes in my browser and set view-header
to panel-heading
and view-content
to panel-body
I get the desired effect:
So I know what I want, but how do I achieve this? I'm new to twig and I feel like there must be an easy solution to this out there, I just don't know what it is. Note that I don't want to make every block behave like this, just this one.