http://forge.typo3.org/http://forge.typo3.org/themes/typo3_forge/favicon/favicon.png?17058661692019-02-02T23:04:54ZTYPO3 ForgeTYPO3 Core - Bug #87442: Can't modify/overwrite og:image and twitter:image via TypoScripthttp://forge.typo3.org/issues/87442?journal_id=3944482019-02-02T23:04:54ZRichard Haeserrichard@richardhaeser.com
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Needs Feedback</i></li></ul><p>Hi,</p>
<p>did you check <a class="external" href="https://docs.typo3.org/typo3cms/CoreApiReference/ApiOverview/MetaTagApi/Index.html#typoscript-and-php">https://docs.typo3.org/typo3cms/CoreApiReference/ApiOverview/MetaTagApi/Index.html#typoscript-and-php</a>? Did you try the replace?</p>
<p>In my installation this is working fine.</p> TYPO3 Core - Bug #87442: Can't modify/overwrite og:image and twitter:image via TypoScripthttp://forge.typo3.org/issues/87442?journal_id=3944922019-02-04T12:45:00Zcorbet dynie
<ul></ul><p>First thanks for the reply.<br />The repace property will only prioritize the replacing with a plugin.<br />You are not allowed to replace the values with typoscript.</p>
<p>For example you can use the .field property to create a fallback.<br />This works:<br /><pre>
twitter:title.field = twitter_title // seo_title // title
</pre></p>
<p>But with "twitter:image" and "og:image" this will not work. <br />You are not allowed to change the cType.</p>
<p>For example, this does not work:<br /><pre>
twitter:image = IMAGE
twitter:image {
file {
import.data = levelmedia:-1, slide
treatIdAsReference = 1
import.listNum = 0
}
}
</pre><br />or<br /><pre>
twitter:image.stdWrap.cObject = IMAGE
twitter:image.stdWrap.cObject {
file {
import.data = levelmedia:-1, slide
treatIdAsReference = 1
import.listNum = 0
}
}
</pre></p> TYPO3 Core - Bug #87442: Can't modify/overwrite og:image and twitter:image via TypoScripthttp://forge.typo3.org/issues/87442?journal_id=3964482019-03-09T21:35:55ZRiccardo De Contardierredeco@gmail.com
<ul><li><strong>Status</strong> changed from <i>Needs Feedback</i> to <i>New</i></li></ul> TYPO3 Core - Bug #87442: Can't modify/overwrite og:image and twitter:image via TypoScripthttp://forge.typo3.org/issues/87442?journal_id=3975402019-04-03T18:50:03ZRiny van Tiggeleninfo@online-gamer.nl
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Needs Feedback</i></li></ul><p>I have setup the following pages:<br />- Root page with a twitter card image and 1 image in the resources<br />- 1 Subpage without any images</p>
<p>I have tried out the following:</p>
<pre>page.meta.twitter:image.cObject = IMG_RESOURCE
page.meta.twitter:image.cObject {
file {
import.data = levelmedia:-1, slide
treatIdAsReference = 1
import.listNum = 0
}
}</pre>
<p>On my homepage I see the twitter card image as twitter:image<br />On my subpage I see the resources-image from the homepage, as twitter:image</p>
<p>When I add a twitter card image to my subpage, that one is shown as twitter:image</p>
<p>When I add the following line:<br /><pre>page.meta.twitter:image.replace = 1</pre><br />All the pages have the resources-image from the homepage.</p>
<p>What is exactly the preferred situation which is not possible at the moment?</p> TYPO3 Core - Bug #87442: Can't modify/overwrite og:image and twitter:image via TypoScripthttp://forge.typo3.org/issues/87442?journal_id=3990182019-04-26T21:26:55ZBenni Mackbenni@typo3.org
<ul><li><strong>Target version</strong> changed from <i>next-patchlevel</i> to <i>Candidate for patchlevel</i></li></ul> TYPO3 Core - Bug #87442: Can't modify/overwrite og:image and twitter:image via TypoScripthttp://forge.typo3.org/issues/87442?journal_id=4065052019-09-24T13:06:30ZRiccardo De Contardierredeco@gmail.com
<ul></ul><p>I performed the following test on TYPO3 9.5.8</p>
<p>1) TS Setup:</p>
<pre>
page.meta.twitter:image.cObject = IMG_RESOURCE
page.meta.twitter:image.cObject {
file {
import.data = levelmedia:-1, slide
treatIdAsReference = 1
import.listNum = 0
}
}
page.meta.og:image.cObject = IMG_RESOURCE
page.meta.og:image.cObject {
file {
import.data = levelmedia:-1, slide
treatIdAsReference = 1
import.listNum = 0
}
}
</pre>
<p>2) Create at least three pages: "Home page", "Page 1" and "Page 2" (the latter two are subpages of "Home page".</p>
<p>3) Home page > edit page > tab Resources > add a file (fileadmin/test1.png)</p>
<p>4) Page 2 > edit page > tab Resources > add a file (fileadmin/test2.png)</p>
<p>5) Visit the three pages and look on the source code for the meta tags</p>
<a name="Results"></a>
<h3 >Results:<a href="#Results" class="wiki-anchor">¶</a></h3>
<table>
<tr>
<th>Page </th>
<th>image set on Resources Tab </th>
<th>twitter:image meta content </th>
<th>og:image meta content </th>
</tr>
<tr>
<td> Home </td>
<td> test1.png</td>
<td> test1.png </td>
<td> test1.png </td>
</tr>
<tr>
<td> Page 1</td>
<td> <em>none</em> </td>
<td> test1.png </td>
<td> test1.png </td>
</tr>
<tr>
<td> Page 2 </td>
<td> test2.png</td>
<td> test2.png </td>
<td> test2.png </td>
</tr>
</table>
<a name="Note"></a>
<h3 >Note<a href="#Note" class="wiki-anchor">¶</a></h3>
<p>I tried to add to the TS Setup:</p>
<pre>
page.meta.twitter:image.replace = 1
page.meta.og:image.replace = 1
</pre>
<p>And the results are the same. Am I doing something wrong? Is this the expected result?</p> TYPO3 Core - Bug #87442: Can't modify/overwrite og:image and twitter:image via TypoScripthttp://forge.typo3.org/issues/87442?journal_id=4219202020-04-06T14:37:19ZRiny van Tiggeleninfo@online-gamer.nl
<ul></ul><p>I'm sorry, to me this looks like the expected result. The typoscript provides the fallback so the image from the homepage is used on "Page 1" in your example.<br />Since Page 2 has an own image, this is the output.</p>
<p>Could you clarify what the needed result is?</p> TYPO3 Core - Bug #87442: Can't modify/overwrite og:image and twitter:image via TypoScripthttp://forge.typo3.org/issues/87442?journal_id=4382242021-01-08T15:18:41ZRichard Haeserrichard@richardhaeser.com
<ul><li><strong>Status</strong> changed from <i>Needs Feedback</i> to <i>Closed</i></li></ul><p>Closing this ticket because no feedback. If you want to override the meta tags with TypoScript, please use the replace property as documented in <a class="external" href="https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ApiOverview/MetaTagApi/Index.html#typoscript-and-php">https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ApiOverview/MetaTagApi/Index.html#typoscript-and-php</a>.</p>