Project

General

Profile

Actions

Bug #93383

open

og:image only works on rootsite with typoscript & rootline-slide

Added by Gabriel Kaufmann / Typoworx NewMedia over 3 years ago. Updated about 2 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Frontend
Target version:
-
Start date:
2021-01-29
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

My customer requires og:image working on all pages. I tried to fetch the og_image from rootpage (og_image reference).

But it doesn't seem to work on subpages (only rootpage).

og:image {
    required = 1
    attribute = property

    cObject = FILES
    cObject {
        maxItems = 1
        # Notice:
        # og_image has been added to $GLOBALS['TYPO3_CONF_VARS']['FE']['addRootLineFields'] .= ',og_image';
        references.data = fullRootLine: 0, og_image

        renderObj = COA
        renderObj {
            10 = IMG_RESOURCE
            10 {
                file {
                    import.data = file:current:uid
                    treatIdAsReference = 1

                    width = 1200
                    height = 630c
                }

                stdWrap {
                    typolink {
                        parameter.data = TSFE:lastImgResourceInfo|3
                        returnLast = url
                        forceAbsoluteUrl = 1
                    }
                }
            }
        }
    }
}

Btw. twitter:image works fine the same way - even without having to add it to addRootLineFields!

I think there might be a bug or something?! Did not figure out either in TypoScript nor PHP/Core stuff where it stucks.

Actions

Also available in: Atom PDF