CoreCommunity ExtensionsIncubatorDistributionsTYPO3 4.5 ProjectsTYPO3 4.6 ProjectsTYPO3 4.7 ProjectsTYPO3 6.0 ProjectsTYPO3 6.1 ProjectsTYPO3 6.2 Projects (+)

Feature #36912

Add support for DAM to Open Graph feature

Added by Christian Hennecke about 1 year ago. Updated 4 months ago.

Status:Resolved Start date:2012-05-07
Priority:Should have Due date:
Assignee:- % Done:

100%

Category:Frontend
Target version:2.0.0
TYPO3 Version:4.7 Has patch:No
PHP Version: Complexity:easy
Votes: 0

Description

Currently, it doesn't seem possible to use DAM media as image for Open Graph. The partial Resources/Private/Partials/Detail/Opengraph.html only has a hard-coded image location of uploads/tx_news.

patch.diff - Patch against git (2.1 kB) Christian Hennecke, 2012-05-14 17:03

Associated revisions

Revision e049e029
Added by Georg Ringer 4 months ago

[FEATURE] DAM support for OpenGraph partial

Support DAM images for the open graph image partial

Change-Id: Iab220d09c9a37d3bb0d9cfab87b4d70f84137d71
Resolves: #36912
Reviewed-on: https://review.typo3.org/17404
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer

History

Updated by Georg Ringer about 1 year ago

wanna do the patch for that?

Updated by Christian Hennecke about 1 year ago

Here you are. This is the first time I'm working with Fluid and I'm currently not at a system that has all the necessary stuff installed, so please excuse any non-elegant solutions and the lack of diff files.

In Classes/Domain/Model/News.php change line 646 from:

if ($mediaElement->getShowinpreview() && $mediaElement->getType() == 0) {

to:

if ($mediaElement->getShowinpreview() && ($mediaElement->getType() == 0 || $mediaElement->getType() == 3)) {

In Resources/Private/Partials/Detail/Opengraph.html, replace lines 10 to 15

<f:if condition="{newsItem.firstImagePreview.image}">
    <n:metaTag
        property="og:image" 
        content="{f:uri.image(src:'uploads/tx_news/{newsItem.firstImagePreview.image}' maxWidth:'100')}" 
        forceAbsoluteUrl="1" />
</f:if>

with:

<f:if condition="{newsItem.firstImagePreview.image}">
    <f:then>
        <n:metaTag
            property="og:image" 
            content="{f:uri.image(src:'uploads/tx_news/{newsItem.firstImagePreview.image}' maxWidth:'100')}" 
            forceAbsoluteUrl="1" />
    </f:then>
    <f:else>
        <f:if condition="{newsItem.firstImagePreview.dam}">
            <n:format.dam as="dam" uid="{newsItem.firstImagePreview.uid}">
                <n:metaTag
                    property="og:image" 
                    content="{f:uri.image(src:'{dam.file_path}{dam.file_name}' maxWidth:'100')}" 
                    forceAbsoluteUrl="1" />
            </n:format.dam>
        </f:if>
    </f:else>
</f:if>

Updated by Christian Hennecke about 1 year ago

OK, here's the actual patch against the git repository.

Updated by Georg Ringer 4 months ago

  • Status changed from New to Resolved
  • Target version set to 2.0.0
  • % Done changed from 0 to 100
  • Complexity set to easy

Also available in: Atom PDF