|
@@ -186,6 +186,14 @@ function materiotheme_theme_suggestions_field_alter(&$suggestions, &$vars){
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * Implements hook_theme_suggestions_HOOK_alter().
|
|
|
+ */
|
|
|
+function materiotheme_theme_suggestions_image_alter(array &$suggestions, array $variables){
|
|
|
+ // $image = $variables['attributes']['class'][0];
|
|
|
+ $suggestions[] = 'image__'.$variables['style_name'];
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* Prepares variables for product templates.
|
|
|
*
|
|
@@ -224,3 +232,13 @@ function materiotheme_preprocess_printable(array &$variables) {
|
|
|
$variables['site_name'] = $site_config->get('name');
|
|
|
$variables['slogan'] = $site_config->get('slogan');
|
|
|
}
|
|
|
+
|
|
|
+// TODO: instead of lazy load home images, make a html light home (without images),
|
|
|
+// replaced then by rich home vuejs
|
|
|
+
|
|
|
+// function materiotheme_preprocess_image(array &$variables) {
|
|
|
+// if ($variables['style_name'] === 'card_small_home') {
|
|
|
+// $variables['attributes']['data-src'] = $variables['attributes']['src'];
|
|
|
+// $variables['attributes']['src'] = '/themes/custom/materiotheme/assets/img/blank.gif';
|
|
|
+// }
|
|
|
+// }
|