From ddb02ef4d8c635b65d0703033d5eaf2b246593db Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christian=20E=C3=9Fl?= <indy.essl@gmail.com>
Date: Sat, 4 Apr 2020 15:16:32 +0200
Subject: [PATCH] [DOCS][BUGFIX] Fix docs on how to set a fallback og:image

The current solution for setting a fallback og:image/twitter:image in
the docs of ext:seo would generate relative urls, which is not desired
for these kind of resources. Improve the docs with a solution, that
enforces absolute urls.

Resolves: #90830
Releases: master
Change-Id: Ibc254f2f157dfac0da2d748b475da1617ecee1c1
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/64070
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Daniel Siepmann <coding@daniel-siepmann.de>
Tested-by: Richard Haeser <richard@maxserv.com>
Reviewed-by: Daniel Siepmann <coding@daniel-siepmann.de>
Reviewed-by: Richard Haeser <richard@maxserv.com>
---
 .../seo/Documentation/Configuration/Index.rst  | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/typo3/sysext/seo/Documentation/Configuration/Index.rst b/typo3/sysext/seo/Documentation/Configuration/Index.rst
index fcad0494bd04..b880d9ee01a2 100644
--- a/typo3/sysext/seo/Documentation/Configuration/Index.rst
+++ b/typo3/sysext/seo/Documentation/Configuration/Index.rst
@@ -156,13 +156,23 @@ If you want to have a fallback og:image or twitter:image, you can use this littl
 
    page {
      meta {
-       og:image.stdWrap.cObject = IMG_RESOURCE
+       og:image.stdWrap.cObject = TEXT
        og:image.stdWrap.cObject {
-         file = EXT:your_extension/Resources/Public/Backend/OgImage.svg
+         stdWrap.typolink {
+           parameter.stdWrap.cObject = IMG_RESOURCE
+           parameter.stdWrap.cObject.file = EXT:your_extension/Resources/Public/Backend/OgImage.svg
+           returnLast = url
+           forceAbsoluteUrl = 1
+         }
        }
-       twitter:image.stdWrap.cObject = IMG_RESOURCE
+       twitter:image.stdWrap.cObject = TEXT
        twitter:image.stdWrap.cObject {
-         file = EXT:your_extension/Resources/Public/Backend/TwitterCardImage.svg
+         stdWrap.typolink {
+           parameter.stdWrap.cObject = IMG_RESOURCE
+           parameter.stdWrap.cObject.file = EXT:your_extension/Resources/Public/Backend/TwitterCardImage.svg
+           returnLast = url
+           forceAbsoluteUrl = 1
+         }
        }
      }
    }
-- 
GitLab