Quellcode durchsuchen

add setvariable sitemap

cedric vor 3 Jahren
Ursprung
Commit
c68e01d090
1 geänderte Dateien mit 19 neuen und 0 gelöschten Zeilen
  1. 19 0
      chcreateur.php

+ 19 - 0
chcreateur.php

@@ -49,6 +49,7 @@ class Chcreateur extends Module implements WidgetInterface
 			//&& $this->registerHook('displayBlockPosition2')
 			&& $this->registerHook('displayHeader')
 			&& $this->registerHook('ModuleRoutes')
+			&& $this->registerHook('ActionFrontControllerSetVariables')
 			&& $this->Register_SQL()
 			&& $this->_installTab()
 			&& Configuration::updateValue('CHCREATEUR_TITLE', 'Nos createurs')
@@ -613,4 +614,22 @@ class Chcreateur extends Module implements WidgetInterface
             $rule = 'xipblog-single-module';
         }
     }
+
+	public function hookActionFrontControllerSetVariables()
+	{	
+		$posts = Chcreapost::getAllSelections(5);
+		$links = [];
+		foreach($posts as $post ) {
+			$links[] = [
+				'id' => 'chcreapost-' . $post['id_chcreaposts'],
+				'label' => $post['post_title'],
+				'url' => $post['link']
+			];
+		}
+		return [
+			'title' => Configuration::get('CHCREATEUR_TITLE'),
+			'links' => $links,
+		];
+	}
+
 }