2024-07-10 16:16:51 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
2024-07-15 16:34:28 +02:00
|
|
|
* Functions to support theming in the caravane theme.
|
2024-07-10 16:16:51 +02:00
|
|
|
*/
|
|
|
|
|
2024-07-15 16:34:28 +02:00
|
|
|
function caravane_page_attachments_alter(&$page) {
|
|
|
|
if (getenv('APP_ENV') === 'development') {
|
|
|
|
// $attachments['#attached']['html_head'][] = [['src' => 'http://localhost:5173/@vite/client', 'type' => 'module'],'vite-client'];
|
|
|
|
// $page['#attached']['library'][] = 'http://localhost:5173/@vite/client';
|
|
|
|
// $attachments['#attached']['html_head'][] = [['src' => 'http://localhost:5173/assets/js/main.js', 'type' => 'module'],'vite-main'];
|
|
|
|
// $page['#attached']['library'][] = 'http://localhost:5173/assets/js/main.js';
|
|
|
|
$page['#attached']['library'][] = 'caravane/vitehmr';
|
2024-07-16 17:01:09 +02:00
|
|
|
}else{
|
|
|
|
$page['#attached']['library'][] = 'caravane/global';
|
2024-07-15 16:34:28 +02:00
|
|
|
}
|
|
|
|
}
|
2024-07-10 16:16:51 +02:00
|
|
|
/**
|
|
|
|
* Implements hook_preprocess_HOOK() for html.html.twig.
|
|
|
|
*/
|
|
|
|
function caravane_preprocess_html(&$variables) {
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implements hook_preprocess_HOOK() for page.html.twig.
|
|
|
|
*/
|
|
|
|
function caravane_preprocess_page(&$variables) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implements hook_preprocess_HOOK() for node.html.twig.
|
|
|
|
*/
|
|
|
|
function caravane_preprocess_node(&$variables) {
|
|
|
|
|
|
|
|
}
|
2024-07-16 17:01:09 +02:00
|
|
|
|
2024-08-09 17:04:53 +02:00
|
|
|
function cavarane_preprocess_block(&$variables) {
|
2024-08-05 21:08:09 +02:00
|
|
|
|
2024-08-09 17:04:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function caravane_theme_suggestions_views_view_field_alter(array &$suggestions, array $variables) {
|
|
|
|
$view = $variables['view'];
|
|
|
|
$display_id = $variables['view']->current_display;
|
|
|
|
if ($display_id == 'block_1' && $view->id() == 'etapes') {
|
|
|
|
$suggestions[] = 'views_view_field__block_1__etape_list';
|
|
|
|
}
|
|
|
|
if ($display_id == 'block_2') {
|
|
|
|
$suggestions[] = 'views_view_field__block_2__popup_map';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function caravane_theme_suggestions_views_view_fields_alter(array &$suggestions, array $variables) {
|
|
|
|
$view = $variables['view'];
|
|
|
|
$display_id = $variables['view']->current_display;
|
|
|
|
$view_id = $view->id();
|
|
|
|
if ($display_id == 'block_1' && $view_id == 'etapes') {
|
|
|
|
$suggestions[] = 'views_view_fields__block_2__liste_etapes';
|
|
|
|
}
|
2024-08-05 21:08:09 +02:00
|
|
|
}
|