|
@@ -8,6 +8,8 @@
|
|
|
use Drupal\Core\Url;
|
|
|
use Drupal\Core\Form\FormStateInterface;
|
|
|
use Drupal\Core\Template\Attribute;
|
|
|
+use Drupal\Component\Utility\Unicode;
|
|
|
+use Drupal\Core\Render\Element;
|
|
|
|
|
|
// function edlptheme_preprocess_input(&$vars){
|
|
|
// dsm($vars, 'vars');
|
|
@@ -133,3 +135,28 @@ function edlptheme_preprocess_node__enregistrement__player_cartel(&$vars){
|
|
|
$vars['col_right'] = true;
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * Prepares variables for image formatter templates.
|
|
|
+ *
|
|
|
+ * Default template: image-formatter.html.twig.
|
|
|
+ *
|
|
|
+ * @param array $variables
|
|
|
+ * An associative array containing:
|
|
|
+ * - item: An ImageItem object.
|
|
|
+ * - item_attributes: An optional associative array of html attributes to be
|
|
|
+ * placed in the img tag.
|
|
|
+ * - image_style: An optional image style.
|
|
|
+ * - url: An optional \Drupal\Core\Url object.
|
|
|
+ */
|
|
|
+function edlptheme_preprocess_image_formatter(&$vars){
|
|
|
+ if(isset($vars['url'])){
|
|
|
+ $system_path = $vars['url']->getInternalPath();
|
|
|
+ $vars['link_attributes'] = new Attribute(array(
|
|
|
+ 'data-drupal-link-system-path' => $system_path=='' ? '<front>' : $system_path,
|
|
|
+ 'class' => array('ajax-link')
|
|
|
+ ));
|
|
|
+ // dpm($vars);
|
|
|
+ }
|
|
|
+}
|