From 3c45d77023c8a9053a029ba9fc85c8c79f50624e Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Tue, 28 Apr 2020 15:06:49 +0200 Subject: [PATCH] =?UTF-8?q?075=20optimisation=20m=C3=A9ta=20d'un=20article?= =?UTF-8?q?=20de=20blog?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/core/core.php b/core/core.php index 9956ceb8..a87fc162 100755 --- a/core/core.php +++ b/core/core.php @@ -36,7 +36,7 @@ class common { const THUMBS_WIDTH = 640; // Numéro de version - const ZWII_VERSION = '10.0.073'; + const ZWII_VERSION = '10.0.075'; const ZWII_UPDATE_CHANNEL = "v10"; public static $actions = []; @@ -1535,13 +1535,16 @@ class core extends common { } // Importe le module else { - // Id du module, et valeurs en sortie de la page si il s'agit d'un module de page + // Id du module, et valeurs en sortie de la page si il s'agit d'un module de page if($access AND $this->getData(['page', $this->getUrl(0), 'moduleId'])) { $moduleId = $this->getData(['page', $this->getUrl(0), 'moduleId']); $this->addOutput([ 'title' => $title, - 'metaDescription' => $this->getData(['page', $this->getUrl(0), 'metaDescription']), + // Meta description = 160 premiers caractères de l'article + 'metaDescription' => $this->getData(['page',$this->getUrl(0),'moduleId']) === 'blog' && !empty($this->getUrl(1)) + ? substr($this->getData(['module',$this->getUrl(0),$this->getUrl(1),'content']) ,0,159) + : $this->getData(['page', $this->getUrl(0), 'metaDescription']), 'metaTitle' => $this->getData(['page', $this->getUrl(0), 'metaTitle']), 'typeMenu' => $this->getData(['page', $this->getUrl(0), 'typeMenu']), 'iconUrl' => $this->getData(['page', $this->getUrl(0), 'iconUrl']), @@ -2249,8 +2252,8 @@ class layout extends common { * Affiche la meta description */ public function showMetaDescription() { - echo ''; - echo ''; + echo ''; + echo ''; } /**