From 3294cdede68f8ee3d060a7484c90b2e5435a4c43 Mon Sep 17 00:00:00 2001 From: "stephen@cubedesigners.com" Date: Tue, 2 Jun 2020 10:24:40 +0000 Subject: [PATCH] Microdata, SEO and styling adjustments. WIP #3641 @3.5 --- framework/application/configs/application.ini | 4 ++-- framework/application/views/helpers/BlogBody.php | 8 ++++---- framework/application/views/helpers/BlogIndex.php | 2 +- framework/application/views/helpers/BlogIntro.php | 10 +++++++--- .../application/views/scripts/blogpost/index.phtml | 3 +++ less/610-blog.less | 11 +++++++---- 6 files changed, 24 insertions(+), 14 deletions(-) diff --git a/framework/application/configs/application.ini b/framework/application/configs/application.ini index fb20317..a659834 100644 --- a/framework/application/configs/application.ini +++ b/framework/application/configs/application.ini @@ -70,9 +70,9 @@ privacy.analytics = 1 [testing : production] dev = true -firephp = true +firephp = false -minify.js = false +;minify.js = false seo.universalAnalytics = UA-4339912-9 diff --git a/framework/application/views/helpers/BlogBody.php b/framework/application/views/helpers/BlogBody.php index 6dcdb08..7f04901 100644 --- a/framework/application/views/helpers/BlogBody.php +++ b/framework/application/views/helpers/BlogBody.php @@ -4,8 +4,8 @@ class Fluidbook_View_Helper_BlogBody extends CubeIT_View_Helper_Abstract { public function blogBody(Fluidbook_Model_Blog $post) { - $res = '
'; - $res .= '
'; + $res = '
'; + $res .= '
'; foreach ($post->getContent() as $content) { @@ -26,7 +26,7 @@ class Fluidbook_View_Helper_BlogBody extends CubeIT_View_Helper_Abstract { // Author details $photo = $this->imageProcess()->imageProcessGetUrl($this->author->getPhoto(), null, 120, 120); - $res .= '
'; + $res .= ''; // .blog-post-body - $res .= '
'; // .content-wrapper + $res .= '
'; // .content-wrapper return $res; } diff --git a/framework/application/views/helpers/BlogIndex.php b/framework/application/views/helpers/BlogIndex.php index c24ec0d..be14112 100644 --- a/framework/application/views/helpers/BlogIndex.php +++ b/framework/application/views/helpers/BlogIndex.php @@ -20,7 +20,7 @@ class Fluidbook_View_Helper_BlogIndex extends CubeIT_View_Helper_Abstract { foreach ($posts as $post) { /* @var $post Fluidbook_Model_Blog */ - $res .= $this->htmlElement($this->blogIntro($post, false), 'article', ['itemProp' => 'blogPost']); + $res .= $this->htmlElement($this->blogIntro($post, false), 'article', ['itemscope' => null, 'itemtype' => 'http://schema.org/Article']); } return $this->htmlElement($res, 'div', ['class' => 'blog-index']); diff --git a/framework/application/views/helpers/BlogIntro.php b/framework/application/views/helpers/BlogIntro.php index d115af1..aae2e18 100644 --- a/framework/application/views/helpers/BlogIntro.php +++ b/framework/application/views/helpers/BlogIntro.php @@ -15,7 +15,7 @@ class Fluidbook_View_Helper_BlogIntro extends CubeIT_View_Helper_Abstract { $title = $post->getTitle(); $title_tag = 'h1'; } else { - $title = $this->link($post->getTitle(), $URL); + $title = $this->link($post->getTitle(), $URL, ['itemprop' => 'url']); $title_tag = 'h2'; } @@ -28,9 +28,13 @@ class Fluidbook_View_Helper_BlogIntro extends CubeIT_View_Helper_Abstract { $res .= $this->dateTime( $post->getPublishDate(), CubeIT_Date::DAY .' '. CubeIT_Date::MONTH_NAME .' '. CubeIT_Date::YEAR, - ['class' => 'blog-intro-date'] + [ + 'class' => 'blog-intro-date', + 'datetime' => $post->getPublishDate()->toString(Zend_Date::ISO_8601), + 'itemprop' => 'datePublished', + ] ); - $res .= $this->title($title, $title_tag, ['class' => 'blog-intro-title']); + $res .= $this->title($title, $title_tag, ['class' => 'blog-intro-title', 'itemprop' => 'headline']); $res .= $this->markupDotclear($post->getExcerpt(), [], ['class' => 'blog-intro-excerpt']); $res .= '
'; // .col-2 $res .= '
'; // .grid diff --git a/framework/application/views/scripts/blogpost/index.phtml b/framework/application/views/scripts/blogpost/index.phtml index bc694b4..a50c38f 100644 --- a/framework/application/views/scripts/blogpost/index.phtml +++ b/framework/application/views/scripts/blogpost/index.phtml @@ -5,7 +5,10 @@ $attributes = [ 'data-header-theme' => $this->post->getIntroStyle(), ]; +echo '
'; echo $this->htmlElement($this->blogIntro($this->post), 'section', $attributes); echo $this->blogBody($this->post); +echo '
'; + echo $this->contactFooter(); diff --git a/less/610-blog.less b/less/610-blog.less index 88f833d..174b7d2 100644 --- a/less/610-blog.less +++ b/less/610-blog.less @@ -21,17 +21,17 @@ align-items: center; // Extra padding to ensure text doesn't get too close to edges or overlap when under a header - // Padding is symmetrical so that vertical centre is not thrown off + // Padding is symmetrical so that vertical centre is not thrown off. However, on smaller screens this is not relevant. padding: 144px 0 !important; @media @m1280 { - padding: 86px 0 !important; + padding: 106px 0 66px !important; } @media @m900 { - padding: 96px 0 !important; + padding: 116px 0 76px !important; } @media @m768 { - padding: 75px 0 !important; + padding: 95px 0 55px !important; } @media @m1024 { @@ -139,6 +139,9 @@ max-width: 1008px; width: 100%; + @media @m1280 { + font-size: 22px; + } @media @m1024 { font-size: 20px; } -- 2.39.5