Skip to content
This repository was archived by the owner on Jan 7, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion localgov_theme.theme
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* LocalGovDrupal theme file.
*/

use Drupal\Component\Utility\Html;
use Drupal\Core\Template\Attribute;
use Drupal\node\Entity\Node;
use Drupal\node\NodeInterface;
Expand Down Expand Up @@ -74,9 +75,11 @@ function localgov_theme_preprocess_page(&$variables) {

/**
* Implements hook_preprocess_HOOK().
*
* - Adds an Id attribute based on the fieldname.
*/
function localgov_theme_preprocess_field(&$variables) {
$variables['attributes']['id'] = 'field--' . $variables['field_name'];
$variables['attributes']['id'] = Html::getUniqueId('field--' . $variables['field_name']);
}

/**
Expand Down