From f7990e312dcab7de17e1b42035bcaf479ba3d541 Mon Sep 17 00:00:00 2001 From: ebakernz Date: Fri, 18 Nov 2022 10:07:51 +1300 Subject: [PATCH] Develop (#13) * Update namespace in composer * Upgrade/php8.1 (#12) * add conditional template rendering * set default * move tabs to settingsFields * template logic for meta description * fix classname check * add html sitemap page; * sitemap template * sitempa func * template local * include template * template updates * template fix * template fix * remove error pgs from sitemaps * exclude self from html sitemap * remove css * filters * Feature/schemas (#9) * add schema code * namespaces * list item * namespaces * namespaces * local bus schema * local bus schema config settings * phone schema setting * address schema fix * org schema name fix * contact point schema * lat lng * lat lng * manual schema * manual schema * manual schema * read me update * read me * readme * readme Co-authored-by: ebakernz * adding to headtag template to give pages default metatitle (#11) * if conditions Co-authored-by: Jeremy Cole Co-authored-by: jack Co-authored-by: jack Co-authored-by: Oscar Co-authored-by: ebakernz Co-authored-by: oscarholt <38869989+oscarholt@users.noreply.github.com> Co-authored-by: psdigital Co-authored-by: jack Co-authored-by: jack Co-authored-by: Oscar Co-authored-by: ebakernz Co-authored-by: oscarholt <38869989+oscarholt@users.noreply.github.com> --- composer.json | 4 ++-- src/Forms/MetaPreviewField.php | 4 +++- src/Model/Extension/SeoPageExtension.php | 4 +++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index bd87516..4cf164e 100644 --- a/composer.json +++ b/composer.json @@ -36,8 +36,8 @@ }, "autoload": { "psr-4": { - "CyberDuck\\SEO\\": "src/", - "CyberDuck\\SEO\\Tests\\": "tests/" + "PlasticStudio\\SEO\\": "src/", + "PlasticStudio\\SEO\\Tests\\": "tests/" } }, "extra": { diff --git a/src/Forms/MetaPreviewField.php b/src/Forms/MetaPreviewField.php index d1e7474..c3bacd8 100644 --- a/src/Forms/MetaPreviewField.php +++ b/src/Forms/MetaPreviewField.php @@ -111,7 +111,9 @@ private function getPageMetaDescription() if(class_exists(BlogPost::class)) { if($this->page instanceof BlogPost) { if($this->page->Parent()->DefaultPostMetaDescription == 1) { - return strip_tags($this->page->Summary); + if ($this->page->Summary) { + return strip_tags($this->page->Summary); + } } } } diff --git a/src/Model/Extension/SeoPageExtension.php b/src/Model/Extension/SeoPageExtension.php index fc84a23..2da00cb 100644 --- a/src/Model/Extension/SeoPageExtension.php +++ b/src/Model/Extension/SeoPageExtension.php @@ -459,7 +459,9 @@ public function getPageMetaDescription() if(class_exists(BlogPost::class)) { if($this->owner instanceof BlogPost) { if($this->owner->Parent()->DefaultPostMetaDescription == 1) { - return strip_tags($this->owner->Summary); + if ($this->page->Summary) { + return strip_tags($this->page->Summary); + } } } }