ThemeSuggestions.php in Open Social 8.8
File
themes/socialblue/src/Plugin/Alter/ThemeSuggestions.php
View source
<?php
namespace Drupal\socialblue\Plugin\Alter;
use Drupal\socialbase\Plugin\Alter\ThemeSuggestions as BaseThemeSuggestions;
class ThemeSuggestions extends BaseThemeSuggestions {
public function alter(&$suggestions, &$context = NULL, &$hook = NULL) {
parent::alter($suggestions, $context, $hook);
$style = theme_get_setting('style');
if (!empty($style)) {
$variables = $this->variables;
$style_suggestions = [];
$style_suggestions[] = $variables['theme_hook_original'] . '__' . $style;
if (!empty($suggestions)) {
foreach ($suggestions as $suggestion) {
$style_suggestions[] = $suggestion;
$style_suggestions[] = $suggestion . '__' . $style;
}
}
$suggestions = $style_suggestions;
}
}
}