-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #399 from localgovdrupal/feature/3.x/326-facets-fo…
…rm-support Feature: Support for the facets_form module
- Loading branch information
Showing
6 changed files
with
279 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
templates/checkboxes--localgov-directories-facets.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{# | ||
/** | ||
* @file | ||
* Default theme template for directory facet checkboxes. | ||
* | ||
* These checkboxes are used within the facets_form_checkbox facet widget. | ||
* | ||
* Available variables: | ||
* - title: Optional list title. | ||
* - grouped_options: checkboxes grouped by their corresponding LocalGov Directory facet type. Each group array contains: | ||
* - title: Label of the facet type. | ||
* - items: Checkbox element. | ||
* - weight: Sorting weight of the facet type. | ||
* - attributes: HTML attributes to be applied to the list. | ||
* | ||
* @see template_preprocess_checkboxes__localgov_directories_facets() | ||
*/ | ||
#} | ||
<div class="facets-widget facets-widget--facets-form-checkbox"> | ||
|
||
{%- if title is not empty -%} | ||
<h3>{{ title }}</h3> | ||
{%- endif -%} | ||
|
||
{% if grouped_options %} | ||
<ul{{ attributes }}> | ||
{%- for group_id, group_record in grouped_options -%} | ||
<li> | ||
<h4 class="facet-group__title">{{ group_record.title }}</h4> | ||
|
||
<ul{{ attributes.addClass('facet-filter-checkboxes') }}> | ||
{%- for checkbox in group_record.items -%} | ||
<li>{{ checkbox }}</li> | ||
{%- endfor -%} | ||
</ul> | ||
</li> | ||
{%- endfor -%} | ||
</ul> | ||
{%- endif %} | ||
</div> |
Oops, something went wrong.