Integration of Cesium JS 3D mapping software with Drupal 8
logicp 0088eddc58 Fixing indent | 7 éve | |
---|---|---|
boutique_data | 7 éve | |
config_import_files | 7 éve | |
mapui | 7 éve | |
qd30map | 7 éve | |
zone_data | 7 éve | |
README.md | 7 éve |
Integration of Cesium JS 3D mapping software with Drupal 8
Be sure to stick this in your theme:
function myTheme_preprocess_page(&$variables) {
$langCode = \Drupal::languageManager()->getCurrentLanguage()->getId();
if (\Drupal::service('path.current')->getPath() === '/map') {
if ($langCode === 'fr') {
$variables['#attached']['library'][] = 'qd30map/cesiumAdditionsFr';
} else {
$variables['#attached']['library'][] = 'qd30map/cesiumAdditions';
}
}
if (isset($variables['node'])) {
if ($variables['node']->getType() == 'boutique') {
$variables['#attached']['library'][] = 'qd30map/cesiumMini';
$node = \Drupal::routeMatch()->getParameter('node');
if ($node) {
$variables['#attached']['drupalSettings']['boutique_title'] = $node->getTitle();
}
}
}
}