Merge branch 'master' of gitea-figureslibres.io:bachir/drupal-quartiersdedemain
This commit is contained in:
commit
fb294a22d6
|
@ -11,7 +11,7 @@ bundle: actualite
|
||||||
label: 'Menu link'
|
label: 'Menu link'
|
||||||
description: 'Computed menu link for the node (only available during node saving).'
|
description: 'Computed menu link for the node (only available during node saving).'
|
||||||
required: false
|
required: false
|
||||||
translatable: false
|
translatable: true
|
||||||
default_value: { }
|
default_value: { }
|
||||||
default_value_callback: ''
|
default_value_callback: ''
|
||||||
settings:
|
settings:
|
||||||
|
|
|
@ -13,7 +13,7 @@ bundle: actualite
|
||||||
label: 'Metatags (Hidden field for JSON support)'
|
label: 'Metatags (Hidden field for JSON support)'
|
||||||
description: 'The computed meta tags for the entity.'
|
description: 'The computed meta tags for the entity.'
|
||||||
required: false
|
required: false
|
||||||
translatable: false
|
translatable: true
|
||||||
default_value: { }
|
default_value: { }
|
||||||
default_value_callback: ''
|
default_value_callback: ''
|
||||||
settings: { }
|
settings: { }
|
||||||
|
|
|
@ -11,7 +11,7 @@ bundle: actualite
|
||||||
label: Title
|
label: Title
|
||||||
description: ''
|
description: ''
|
||||||
required: true
|
required: true
|
||||||
translatable: false
|
translatable: true
|
||||||
default_value: { }
|
default_value: { }
|
||||||
default_value_callback: ''
|
default_value_callback: ''
|
||||||
settings: { }
|
settings: { }
|
||||||
|
|
|
@ -14,7 +14,7 @@ bundle: actualite
|
||||||
label: Body
|
label: Body
|
||||||
description: ''
|
description: ''
|
||||||
required: false
|
required: false
|
||||||
translatable: false
|
translatable: true
|
||||||
default_value: { }
|
default_value: { }
|
||||||
default_value_callback: ''
|
default_value_callback: ''
|
||||||
settings:
|
settings:
|
||||||
|
|
|
@ -14,7 +14,7 @@ bundle: actualite
|
||||||
label: Fichiers
|
label: Fichiers
|
||||||
description: ''
|
description: ''
|
||||||
required: false
|
required: false
|
||||||
translatable: false
|
translatable: true
|
||||||
default_value: { }
|
default_value: { }
|
||||||
default_value_callback: ''
|
default_value_callback: ''
|
||||||
settings:
|
settings:
|
||||||
|
|
|
@ -6,7 +6,14 @@ dependencies:
|
||||||
- field.storage.node.field_images
|
- field.storage.node.field_images
|
||||||
- node.type.actualite
|
- node.type.actualite
|
||||||
module:
|
module:
|
||||||
|
- content_translation
|
||||||
- image
|
- image
|
||||||
|
third_party_settings:
|
||||||
|
content_translation:
|
||||||
|
translation_sync:
|
||||||
|
alt: alt
|
||||||
|
title: title
|
||||||
|
file: '0'
|
||||||
id: node.actualite.field_images
|
id: node.actualite.field_images
|
||||||
field_name: field_images
|
field_name: field_images
|
||||||
entity_type: node
|
entity_type: node
|
||||||
|
@ -14,7 +21,7 @@ bundle: actualite
|
||||||
label: Images
|
label: Images
|
||||||
description: ''
|
description: ''
|
||||||
required: false
|
required: false
|
||||||
translatable: false
|
translatable: true
|
||||||
default_value: { }
|
default_value: { }
|
||||||
default_value_callback: ''
|
default_value_callback: ''
|
||||||
settings:
|
settings:
|
||||||
|
|
|
@ -14,7 +14,7 @@ bundle: actualite
|
||||||
label: Liens
|
label: Liens
|
||||||
description: ''
|
description: ''
|
||||||
required: false
|
required: false
|
||||||
translatable: false
|
translatable: true
|
||||||
default_value: { }
|
default_value: { }
|
||||||
default_value_callback: ''
|
default_value_callback: ''
|
||||||
settings:
|
settings:
|
||||||
|
|
|
@ -8,7 +8,7 @@ dependencies:
|
||||||
- content_translation
|
- content_translation
|
||||||
third_party_settings:
|
third_party_settings:
|
||||||
content_translation:
|
content_translation:
|
||||||
enabled: false
|
enabled: true
|
||||||
bundle_settings:
|
bundle_settings:
|
||||||
untranslatable_fields_hide: '0'
|
untranslatable_fields_hide: '0'
|
||||||
id: node.actualite
|
id: node.actualite
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
description: Department(s)
|
|
@ -0,0 +1 @@
|
||||||
|
label: 'Name of the municipality (population)'
|
|
@ -0,0 +1 @@
|
||||||
|
label: 'Name of the priority urban neighborhood (population)'
|
|
@ -0,0 +1 @@
|
||||||
|
label: 'Contracting authority'
|
|
@ -0,0 +1 @@
|
||||||
|
description: 'State programmes'
|
|
@ -0,0 +1 @@
|
||||||
|
label: Region(s)
|
|
@ -0,0 +1,4 @@
|
||||||
|
display:
|
||||||
|
default:
|
||||||
|
display_options:
|
||||||
|
title: Actualities
|
|
@ -144,7 +144,7 @@ display:
|
||||||
options:
|
options:
|
||||||
query_comment: ''
|
query_comment: ''
|
||||||
disable_sql_rewrite: false
|
disable_sql_rewrite: false
|
||||||
distinct: false
|
distinct: true
|
||||||
replica: false
|
replica: false
|
||||||
query_tags: { }
|
query_tags: { }
|
||||||
relationships: { }
|
relationships: { }
|
||||||
|
|
|
@ -21,6 +21,8 @@ class SitesMap extends BlockBase {
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function build() {
|
public function build() {
|
||||||
|
$language = \Drupal::languageManager()->getCurrentLanguage()->getId();
|
||||||
|
|
||||||
$return = null;
|
$return = null;
|
||||||
|
|
||||||
$allSites = \Drupal::entityTypeManager()->getStorage('node')
|
$allSites = \Drupal::entityTypeManager()->getStorage('node')
|
||||||
|
@ -39,12 +41,14 @@ class SitesMap extends BlockBase {
|
||||||
|
|
||||||
|
|
||||||
foreach($allSites as $index => $site){
|
foreach($allSites as $index => $site){
|
||||||
$title = $site->get('title')->getString();
|
// $title = $site->get('title')->getString();
|
||||||
$subtitle = $site->get('field_sous_titre')->getString();
|
$title = $site->hasTranslation($language) ? $site->getTranslation($language)->get('title')->getString() : $site->get('title')->getString();
|
||||||
|
// $subtitle = $site->get('field_sous_titre')->getString();
|
||||||
|
$subtitle = $site->hasTranslation($language) ? $site->getTranslation($language)->get('field_sous_titre')->getString() : $site->get('field_sous_titre')->getString();
|
||||||
|
|
||||||
$link_options = ['absolute' => TRUE, 'attributes' => ['class' => 'site-link']]; // Passer 'absolute' à TRUE
|
$link_options = ['absolute' => TRUE, 'attributes' => ['class' => 'site-link']]; // Passer 'absolute' à TRUE
|
||||||
$site_url = $site->toUrl('canonical', $link_options)->toString(); // URL absolue pour le data-url
|
$site_url = $site->toUrl('canonical', $link_options)->toString(); // URL absolue pour le data-url
|
||||||
$site_link_object = Link::createFromRoute("voir le site", 'entity.node.canonical', ['node' => $site->id()], $link_options);
|
$site_link_object = Link::createFromRoute(t("got to site"), 'entity.node.canonical', ['node' => $site->id()], $link_options);
|
||||||
$link = $site_link_object->toString()->getGeneratedLink();
|
$link = $site_link_object->toString()->getGeneratedLink();
|
||||||
|
|
||||||
$datacontent = htmlspecialchars("<strong>$title</strong><br>$subtitle<br>$link");
|
$datacontent = htmlspecialchars("<strong>$title</strong><br>$subtitle<br>$link");
|
||||||
|
|
Loading…
Reference in New Issue