]> _ Git - cubist_cms-back.git/commitdiff
fix #2967
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 30 Aug 2019 16:04:00 +0000 (18:04 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 30 Aug 2019 16:04:00 +0000 (18:04 +0200)
src/app/Magic/Models/Settings.php
src/app/Magic/PageData.php

index dbd649c48724eed9489a5e10acaddf3d932c3fd5..78a6b13f613bbe1010a40eaa5d9200a645c8ff6d 100644 (file)
@@ -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()
index a907ae5e6b4b076455d373a70e1ce0f0bb89c24d..d2a7fa00180757721f80dd9e7665bd90a8e24681 100644 (file)
@@ -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()