-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Conditional alert banner placement (#142)
* Added Condition Field module (#137) * Added visibility field (#137) * Patch condition_field for missing schema: https://www.drupal.org/project/condition_field/issues/3215202 * Copy configuration for visibility field to new alert banner types (#137 #108) * Only use the request_path plugin for controlling banner visibility. Includes update path for field_condition schema. See: https://www.drupal.org/project/condition_field/issues/3215202#comment-14117352 * Added update hook to add visibility field to existing alert banners * Add visibility field to all existing localgov_alert_banner bundles Co-authored-by: Andy Broomfield <andy.broomfield@brighton-hove.gov.uk>
- Loading branch information
1 parent
ee7fafe
commit 2b829cf
Showing
13 changed files
with
378 additions
and
27 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
24 changes: 24 additions & 0 deletions
24
config/install/field.field.localgov_alert_banner.localgov_alert_banner.visibility.yml
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,24 @@ | ||
langcode: en | ||
status: true | ||
dependencies: | ||
config: | ||
- field.storage.localgov_alert_banner.visibility | ||
- localgov_alert_banner.localgov_alert_banner_type.localgov_alert_banner | ||
module: | ||
- condition_field | ||
id: localgov_alert_banner.localgov_alert_banner.visibility | ||
field_name: visibility | ||
entity_type: localgov_alert_banner | ||
bundle: localgov_alert_banner | ||
label: Visibility | ||
description: 'Set the visibility of the alert to only show it on specific conditions.' | ||
required: false | ||
translatable: false | ||
default_value: { } | ||
default_value_callback: '' | ||
settings: | ||
enabled_plugins: | ||
'entity_bundle:node': false | ||
request_path: true | ||
user_role: false | ||
field_type: condition_field |
18 changes: 18 additions & 0 deletions
18
config/install/field.storage.localgov_alert_banner.visibility.yml
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,18 @@ | ||
langcode: en | ||
status: true | ||
dependencies: | ||
module: | ||
- condition_field | ||
- localgov_alert_banner | ||
id: localgov_alert_banner.visibility | ||
field_name: visibility | ||
entity_type: localgov_alert_banner | ||
type: condition_field | ||
settings: { } | ||
module: condition_field | ||
locked: false | ||
cardinality: 1 | ||
translatable: true | ||
indexes: { } | ||
persist_with_no_fields: false | ||
custom_storage: false |
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 |
---|---|---|
|
@@ -12,3 +12,4 @@ dependencies: | |
- drupal:options | ||
- drupal:user | ||
- drupal:views | ||
- condition_field:condition_field |
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
Oops, something went wrong.