Integration of Cesium JS 3D mapping software with Drupal 8
logicp 0088eddc58 Fixing indent | 7 rokov pred | |
---|---|---|
boutique_data | 7 rokov pred | |
config_import_files | 7 rokov pred | |
mapui | 7 rokov pred | |
qd30map | 7 rokov pred | |
zone_data | 7 rokov pred | |
README.md | 7 rokov pred |
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();
}
}
}
}