Bug #87442

Can't modify/overwrite og:image and twitter:image via TypoScript

Added by corbet dynie 2 months ago. Updated 15 days ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
SEO
Target version:
Start date:
2019-01-15
Due date:
% Done:

0%

TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

It is not possible to overwrite the meta tags via TypoScript.
So you can not create a TypoScript fallback with the media resources.

'page.meta.og:image' has no impact.
'page.meta.twitter:image' can be set and will be overwritten, if you set an image with page settings (twitter_image).
But not the other way round.

History

#1 Updated by Richard Haeser about 2 months ago

  • Status changed from New to Needs Feedback

Hi,

did you check https://docs.typo3.org/typo3cms/CoreApiReference/ApiOverview/MetaTagApi/Index.html#typoscript-and-php? Did you try the replace?

In my installation this is working fine.

#2 Updated by corbet dynie about 2 months ago

First thanks for the reply.
The repace property will only prioritize the replacing with a plugin.
You are not allowed to replace the values with typoscript.

For example you can use the .field property to create a fallback.
This works:

twitter:title.field = twitter_title // seo_title // title

But with "twitter:image" and "og:image" this will not work.
You are not allowed to change the cType.

For example, this does not work:

twitter:image = IMAGE
twitter:image {
    file {
        import.data = levelmedia:-1, slide
        treatIdAsReference = 1
        import.listNum = 0
    }
}


or
twitter:image.stdWrap.cObject = IMAGE
twitter:image.stdWrap.cObject {
    file {
        import.data = levelmedia:-1, slide
        treatIdAsReference = 1
        import.listNum = 0
    }
}

#3 Updated by Riccardo De Contardi 15 days ago

  • Status changed from Needs Feedback to New

Also available in: Atom PDF