I need to overwrite and adjust the twig (template) files from the Facet module in my custom subtheme? Is that possible? I need to change below markup and CSS classes (to debug faster, I also added my template suggestion here):
<!-- THEME DEBUG -->
<!-- THEME HOOK: 'item_list' -->
<!-- BEGIN OUTPUT from 'themes/custom/my_theme/templates/dataset/item-list.html.twig' -->
<div class="item-list">
<ul data-drupal-facet-id="contactvoorkeur" class="js-facets-checkbox-links">
<li class="facet-item">
<input type="checkbox" class="facets-checkbox" id="contactvoorkeur-email" data-facetsredir="/search-person/cards?f[0]=contactvoorkeur%3Aemail">
<label for="contactvoorkeur-email">
<!-- THEME DEBUG -->
<!-- THEME HOOK: 'facets_result_item' -->
<!-- BEGIN OUTPUT from 'modules/contrib/facets/templates/facets-result-item.html.twig' -->
E-mail <span class="facet-count">(4)</span>
<!-- END OUTPUT from 'modules/contrib/facets/templates/facets-result-item.html.twig' -->
</label>
<a href="/search-person/cards?f[0]=contactvoorkeur%3Aemail" rel="nofollow" data-drupal-facet-item-id="contactvoorkeur-email" style="display: none;">
<!-- THEME DEBUG -->
<!-- THEME HOOK: 'facets_result_item' -->
<!-- BEGIN OUTPUT from 'modules/contrib/facets/templates/facets-result-item.html.twig' -->
E-mail <span class="facet-count">(4)</span>
<!-- END OUTPUT from 'modules/contrib/facets/templates/facets-result-item.html.twig' -->
</a>
</li>
<li class="facet-item">
<input type="checkbox" class="facets-checkbox" id="contactvoorkeur-post" data-facetsredir="/search-person/cards?f[0]=contactvoorkeur%3Apost">
<label for="contactvoorkeur-post">
<!-- THEME DEBUG -->
<!-- THEME HOOK: 'facets_result_item' -->
<!-- BEGIN OUTPUT from 'modules/contrib/facets/templates/facets-result-item.html.twig' -->
Post <span class="facet-count">(2)</span>
<!-- END OUTPUT from 'modules/contrib/facets/templates/facets-result-item.html.twig' -->
</label>
<a href="/search-person/cards?f[0]=contactvoorkeur%3Apost" rel="nofollow" data-drupal-facet-item-id="contactvoorkeur-post" style="display: none;">
<!-- THEME DEBUG -->
<!-- THEME HOOK: 'facets_result_item' -->
<!-- BEGIN OUTPUT from 'modules/contrib/facets/templates/facets-result-item.html.twig' -->
Post <span class="facet-count">(2)</span>
<!-- END OUTPUT from 'modules/contrib/facets/templates/facets-result-item.html.twig' -->
</a>
</li>
</ul>
</div>
My main goal is to:
1) How do I add a bootstrap css-class list-group
to the existing facet class js-facets-checkbox-links
. So I get:
<ul data-drupal-facet-id="contactvoorkeur" class="list-group js-facets-checkbox-links">
2) And how do I replace an existing facet class facet-item
with list-group-item
:
<li class="list-group-item">
js-facets-checkbox-links
is added by this file in the facet module folderCheckboxWidget.php
. I have to extend this css class tojs-facets-checkbox-links list-group
? But I don't want to overwrite the contrib module file!