From: Vincent Vanwaelscappel Date: Fri, 30 Aug 2019 16:04:00 +0000 (+0200) Subject: fix #2967 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=15a1a10e46c2a3a8edb3d33f156512fb43fd74f3;p=cubist_cms-back.git fix #2967 --- 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()