You are here

function socialblue_preprocess_group in Open Social 8.8

Same name and namespace in other branches
  1. 8.9 themes/socialblue/socialblue.theme \socialblue_preprocess_group()

Prepares variables for group templates.

File

themes/socialblue/socialblue.theme, line 46
The primary PHP file for the Social Blue theme.

Code

function socialblue_preprocess_group(array &$variables) {
  $view_modes = [
    'teaser',
    'featured',
  ];
  $social_group_types = [
    'open_group',
    'closed_group',
    'public_group',
    'secret_group',
    'flexible_group',
  ];
  if (theme_get_setting('style') === 'sky' && in_array($variables['view_mode'], $view_modes) && in_array($variables['group_type_id'], $social_group_types)) {
    $variables['title_prefix']['teaser_tag'] = [
      '#type' => 'inline_template',
      '#template' => '<div class="teaser__tag">{{ teaser_tag }}</div>',
      '#context' => [
        'teaser_tag' => t('Group'),
      ],
    ];
  }
}