Skip to content

Commit

Permalink
Merge branch 'develop' into feature/3469582-fix-alert-visibiltiy
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua Fernandes committed Sep 19, 2024
2 parents c98d03a + 3d5dedc commit a691b85
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions web/themes/contrib/civictheme/civictheme.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ config_devel:
- core.entity_view_mode.node.civictheme_promo_card
- core.entity_view_mode.node.civictheme_slider_slide
- core.entity_view_mode.node.civictheme_snippet
- core.entity_view_mode.node.civictheme_subject_card
- editor.editor.civictheme_rich_text
- field.field.block_content.civictheme_banner.field_c_b_background_image
- field.field.block_content.civictheme_banner.field_c_b_banner_blend_mode
Expand Down
12 changes: 12 additions & 0 deletions web/themes/contrib/civictheme/civictheme.post_update.php
Original file line number Diff line number Diff line change
Expand Up @@ -760,6 +760,18 @@ function civictheme_post_update_enable_three_column_layout(): string {
return implode("\n", $messages);
}

/**
* Import the missing subject card view mode configuration.
*/
function civictheme_post_update_import_subject_card_view_mode(): void {
$view_mode_configs = [
'core.entity_view_mode.node.civictheme_subject_card' => 'entity_view_mode',
];
$config_path = \Drupal::service('extension.list.theme')->getPath('civictheme') . '/config/install';
\Drupal::classResolver(CivicthemeUpdateHelper::class)->createConfigs($view_mode_configs, $config_path);

}

/**
* Update alert api view to strip tags from visibility validation.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
langcode: en
status: true
dependencies:
module:
- node
id: node.civictheme_subject_card
label: 'Subject Card'
description: ''
targetEntityType: node
cache: true
11 changes: 11 additions & 0 deletions web/themes/contrib/civictheme/includes/cards.inc
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,17 @@ function civictheme_preprocess_paragraph__civictheme_subject_card(array &$variab
_civictheme_preprocess_paragraph__paragraph_field__theme($variables);
}

/**
* Implements template_preprocess_node().
*/
function _civictheme_preprocess_node__civictheme_subject_card(array &$variables): void {
_civictheme_preprocess_paragraph__node_field__image($variables, CivicthemeConstants::SUBJECT_CARD_IMAGE_STYLE);
_civictheme_preprocess_paragraph__node_field__title($variables);
_civictheme_preprocess_paragraph__node_field__link($variables);
// @see civictheme_preprocess_views_view_grid()
$variables['theme'] = $variables['node']->component_theme ?? CivicthemeConstants::THEME_LIGHT;
}

/**
* Implements template_preprocess_paragraph().
*/
Expand Down

0 comments on commit a691b85

Please sign in to comment.