Skip to content

Instantly share code, notes, and snippets.

View andybroomfield's full-sized avatar

Andy Broomfield andybroomfield

View GitHub Profile
@andybroomfield
andybroomfield / views.view.localgov_directory_channel.yml
Created March 6, 2026 10:31
Directory channels view for BEF filters
uuid: 0072dff1-4ae9-4de5-8ddd-343685e9b931
langcode: en
status: true
dependencies:
config:
- field.storage.geo_entity.location
- field.storage.node.body
- search_api.index.localgov_directories_index_default
module:
- better_exposed_filters
@andybroomfield
andybroomfield / localgov_directories--3.x-439-bef-support.patch
Created August 4, 2025 08:57
Patch for localgov_directories better exposed filter support
diff --git a/localgov_directories.module b/localgov_directories.module
index 8acc740..1403fe9 100644
--- a/localgov_directories.module
+++ b/localgov_directories.module
@@ -57,6 +57,10 @@ function localgov_directories_theme() {
'checkboxes__localgov_directories_facets' => [
'base hook' => 'checkboxes',
],
+ 'bef_checkboxes_directory_facets' => [
+ 'render element' => 'element',
version: 2
updates:
- package-ecosystem: "composer"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "07:00"
allow:
@andybroomfield
andybroomfield / refresh-split-repos.sh
Created February 13, 2025 15:32
Split and update repo
#!/bin/bash
# Ensure correct number of arguments
if [ "$#" -ne 3 ]; then
echo "Usage: $0 <USERNAME> <SOURCEREPO> <MODULENAME>"
exit 1
fi
# Assign arguments
USERNAME=$1
@andybroomfield
andybroomfield / IndexItemsSubscriber.php
Created April 27, 2024 16:28
Test Drupal search api index event subscriber for localgov_events date field.
<?php
declare(strict_types=1);
namespace Drupal\localgov_events\EventSubscriber;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Drupal\search_api\Event\SearchApiEvents;
use Drupal\search_api\Event\IndexingItemsEvent;
use Drupal\search_api\Utility\Utility;
@andybroomfield
andybroomfield / FilterConfigSubscriber.php
Created September 20, 2023 08:25
Eventsubscriber to sort text format filters alphapetically in config (still sorted by weight in the filter format itself)
<?php
namespace Drupal\filter_format_config_sort\EventSubscriber;
use Drupal\Core\Config\ConfigEvents;
use Drupal\Core\Config\StorageInterface;
use Drupal\Core\Config\StorageTransformEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
/**
@andybroomfield
andybroomfield / migrate_plus.migration.menu_links.yml
Last active September 26, 2021 13:40
Migrate Drupal 8/9 Menu items into a new Drupal 9 site using migrate_drupal_d8 (seperate databases)
@andybroomfield
andybroomfield / services-menu-accessibility.js
Created July 1, 2021 08:48
BHCC Services mega menu tabbing order
/**
* Accessibility tabbing support for servies megamenu
*/
(function($) {
/**
* Check Key pressed is Tab Key
* @param {Event} e jQuery keypress event
* @return {Boolean}
@andybroomfield
andybroomfield / core.entity_form_display.node.localgov_services_page.default.yml
Last active November 12, 2020 11:39
Field config for test distro field to amend localgov_services_page
langcode: en
status: true
dependencies:
config:
- field.field.node.localgov_services_page.body
- field.field.node.localgov_services_page.field_common_tasks
- field.field.node.localgov_services_page.field_download_links
- field.field.node.localgov_services_page.field_hide_related_topics
- field.field.node.localgov_services_page.field_override_related_links
- field.field.node.localgov_services_page.field_page_components
/**
* Determine if an element is visible by checking visiblity of parents.
*
* A helper around
* \Drupal::service('webform_submission.conditions_validator')->isElementVisible
* @param Array $element
* Webform element.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* Form state object.
* @param Array $complete_form