Skip to content

Instantly share code, notes, and snippets.

View andybroomfield's full-sized avatar

Andy Broomfield andybroomfield

View GitHub Profile
@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 / 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 / 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
version: 2
updates:
- package-ecosystem: "composer"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "07:00"
allow:
@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',
@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