diff --git a/config/sync/block.block.quartiers_de_demain_prevnextblock.yml b/config/sync/block.block.quartiers_de_demain_prevnextblock.yml
new file mode 100644
index 0000000..ef725de
--- /dev/null
+++ b/config/sync/block.block.quartiers_de_demain_prevnextblock.yml
@@ -0,0 +1,28 @@
+uuid: 67f1896c-d7c8-4128-8dcb-aefbd30ec51c
+langcode: fr
+status: true
+dependencies:
+ module:
+ - node
+ - q2d_mod
+ theme:
+ - quartiers_de_demain
+id: quartiers_de_demain_prevnextblock
+theme: quartiers_de_demain
+region: content
+weight: -6
+provider: null
+plugin: prevnext_block
+settings:
+ id: prevnext_block
+ label: 'PrevNext Block'
+ label_display: '0'
+ provider: q2d_mod
+visibility:
+ 'entity_bundle:node':
+ id: 'entity_bundle:node'
+ negate: false
+ context_mapping:
+ node: '@node.node_route_context:node'
+ bundles:
+ actualite: actualite
diff --git a/config/sync/block.block.quartiers_de_demain_titredepage.yml b/config/sync/block.block.quartiers_de_demain_titredepage.yml
index dedb071..16263f7 100644
--- a/config/sync/block.block.quartiers_de_demain_titredepage.yml
+++ b/config/sync/block.block.quartiers_de_demain_titredepage.yml
@@ -7,7 +7,7 @@ dependencies:
id: quartiers_de_demain_titredepage
theme: quartiers_de_demain
region: content
-weight: 0
+weight: -5
provider: null
plugin: page_title_block
settings:
diff --git a/config/sync/core.extension.yml b/config/sync/core.extension.yml
index 901f049..d1c5737 100644
--- a/config/sync/core.extension.yml
+++ b/config/sync/core.extension.yml
@@ -90,6 +90,7 @@ module:
path_alias_xt: 0
pathologic: 0
persistent_login: 0
+ q2d_mod: 0
redis: 0
responsive_image: 0
search_api: 0
diff --git a/web/modules/custom/q2d_mod/q2d_mod.info.yml b/web/modules/custom/q2d_mod/q2d_mod.info.yml
new file mode 100644
index 0000000..54e4be7
--- /dev/null
+++ b/web/modules/custom/q2d_mod/q2d_mod.info.yml
@@ -0,0 +1,7 @@
+name: q2d_mod
+type: module
+description: Provides additional functionality for the site.
+package: Custom
+core_version_requirement: ^9 || ^10
+dependencies:
+ - drupal:block
\ No newline at end of file
diff --git a/web/modules/custom/q2d_mod/q2d_mod.module b/web/modules/custom/q2d_mod/q2d_mod.module
new file mode 100644
index 0000000..9178a83
--- /dev/null
+++ b/web/modules/custom/q2d_mod/q2d_mod.module
@@ -0,0 +1,7 @@
+getParameter('node');
+ if ($node) {
+ $nodetype = $node->getType();
+ if($nodetype === "actualite"){
+ $date = $node->get('field_date')->getString();
+ $allActus = \Drupal::entityTypeManager()->getStorage('node')
+ ->loadByProperties(['type' => 'actualite', 'status' => 1]);
+
+
+
+ usort($allActus, function($a, $b){
+ $dateA = $a->get('field_date')->getString();
+ $dateB = $b->get('field_date')->getString();
+ if ($dateA == $dateB) {
+ return 0;
+ }
+ return ($dateA < $dateB) ? -1 : 1;
+ });
+ $prevnode = null;
+ $nextnode = null;
+ foreach($allActus as $index => $actu){
+ $n = $actu->get('field_date')->getString();
+ if($n === $date){
+ $prevnode = $index - 1 >= 0 ? $allActus[$index - 1] : null;
+ $nextnode = $index + 1 < count($allActus) ? $allActus[$index + 1] : null;
+ break;
+ }
+ }
+
+ $return = [
+ '#cache' => [
+ 'max-age' => 0,
+ ]
+ ];
+
+ if (isset($prevnode)) {
+ $prev_link_title = Markup::create('Précédent');
+ $prev_options = ['absolute' => FALSE, 'attributes' => ['class' => 'prev-actu']];
+ $prev_link_object = Link::createFromRoute($prev_link_title, 'entity.node.canonical', ['node' => $prevnode->id()], $prev_options);
+ $return[] = $prev_link_object->toRenderable();
+ }
+
+ if (isset($nextnode)) {
+ $next_link_title = Markup::create('Suivant');
+ $next_options = ['absolute' => FALSE, 'attributes' => ['class' => 'next-actu']];
+ $next_link_object = Link::createFromRoute($next_link_title, 'entity.node.canonical', ['node' => $nextnode->id()], $next_options);
+ $return[] = $next_link_object->toRenderable();
+ }
+ }
+ }
+
+ return $return;
+ // return [
+ // '#markup' => $this->t('Hello, World!'),
+ // ];
+ }
+ public function getCacheMaxAge() {
+ return 0;
+ }
+}
\ No newline at end of file