From 15a1a10e46c2a3a8edb3d33f156512fb43fd74f3 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Fri, 30 Aug 2019 18:04:00 +0200 Subject: [PATCH] fix #2967 --- src/app/Magic/Models/Settings.php | 8 ++++++++ src/app/Magic/PageData.php | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/app/Magic/Models/Settings.php b/src/app/Magic/Models/Settings.php index dbd649c..78a6b13 100644 --- a/src/app/Magic/Models/Settings.php +++ b/src/app/Magic/Models/Settings.php @@ -110,6 +110,14 @@ class Settings extends CubistMagicModel 'hint' => __('Recommended length: 160 chars'), 'tab' => 'SEO // Meta', ]); + + $this->addField([ + 'name' => 'social_image', + 'label' => 'Image par défaut', + 'type' => 'Images', + 'hint' => 'Utilisée lors du partage sur les réseaux sociaux', + 'tab' => 'SEO // Meta', + ]); } public static function getSettingsClass() diff --git a/src/app/Magic/PageData.php b/src/app/Magic/PageData.php index a907ae5..d2a7fa0 100644 --- a/src/app/Magic/PageData.php +++ b/src/app/Magic/PageData.php @@ -31,7 +31,8 @@ class PageData extends EntityData public function getSocialImage() { - + $settings = Settings::getData(); + return url($this->getImageURL('social_image','', $settings->getImageURL('social_image'))); } public function getRobots() -- 2.39.5