# Og:image Bild für Facebook

**URL:** https://forum.shopware.com/t/og-image-bild-fuer-facebook/93258
**Category:** Shopware 5
**Tags:** programming
**Created:** [4. März 2022 um 12:44 UTC](https://forum.shopware.com/t/og-image-bild-fuer-facebook/93258 "2022-03-04T12:44:06Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![tp11](https://avatars.discourse-cdn.com/v4/letter/t/e9c0ed/32.png) [@tp11](https://forum.shopware.com/u/tp11)
#### Post date: [4. März 2022 um 12:44 UTC](https://forum.shopware.com/t/og-image-bild-fuer-facebook/93258/1 "2022-03-04T12:44:06Z")

</div>

Hallo, leider komme ich hier nicht weiter, oder stehe einfach auf der Leitung.

Versuche das og:image für Facebook mit einem selbstdef. Bild zu ändern.

Inhalt meiner header.tpl im eignen Template.

```auto
{extends file="parent:frontend/index/header.tpl"}
{block name="frontend_index_header_meta_tags_opengraph"}
<meta property="og:image" content="{link file=https://www.yxz.at/bild.png}" />
{/block}

```

Nach dem Cache leeren ist der Shop weg… upps…  
Was übersehe ich hier…

Habe es auch mit „append“ versucht…  
Vielen Dank für eure Hilfe…  
lg  
Tom

---

<div class="post-metadata">

### Author: ![R4M](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/r4m/32/9983_2.png) [@R4M](https://forum.shopware.com/u/R4M)
#### Post date: [4. März 2022 um 13:05 UTC](https://forum.shopware.com/t/og-image-bild-fuer-facebook/93258/2 "2022-03-04T13:05:48Z")

</div>

> [@tp11](#):
>
> `content="{link file=https://www.yxz.at/bild.png}"`

Das macht keinen Sinn, da kannst du gleich

```auto
content="https://www.yxz.at/bild.png"
bzw. auch
content="{url controller='index'}bild.png"

```

schreiben. Vergiss aber die anderen OG-Tags nicht 🙂

---

<div class="post-metadata">

### Author: ![tp11](https://avatars.discourse-cdn.com/v4/letter/t/e9c0ed/32.png) [@tp11](https://forum.shopware.com/u/tp11)
#### Post date: [4. März 2022 um 13:09 UTC](https://forum.shopware.com/t/og-image-bild-fuer-facebook/93258/3 "2022-03-04T13:09:43Z")

</div>

Hallo, danke. Was meinst du mit anderen OG Tags? Merci!

---

<div class="post-metadata">

### Author: ![R4M](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/r4m/32/9983_2.png) [@R4M](https://forum.shopware.com/u/R4M)
#### Post date: [4. März 2022 um 13:12 UTC](https://forum.shopware.com/t/og-image-bild-fuer-facebook/93258/4 "2022-03-04T13:12:20Z")

</div>

> [@tp11](#):
>
> Was meinst du mit anderen OG Tags?

og:type, og:site, og:titel usw. usw. usw. usw. Bei dir wird jetzt nur das Bild übermittelt, weil du den Rest aus dem Block nicht übernommen hast. Siehe:

[https://github.com/shopware/shopware/blob/5.7/themes/Frontend/Bare/frontend/index/header.tpl#L19](https://github.com/shopware/shopware/blob/5.7/themes/Frontend/Bare/frontend/index/header.tpl#L19)

---

<div class="post-metadata">

### Author: ![tp11](https://avatars.discourse-cdn.com/v4/letter/t/e9c0ed/32.png) [@tp11](https://forum.shopware.com/u/tp11)
#### Post date: [4. März 2022 um 13:13 UTC](https://forum.shopware.com/t/og-image-bild-fuer-facebook/93258/5 "2022-03-04T13:13:45Z")

</div>

OK, alles klar. Somit die ganzen Blockdaten einbauen… Merci. teste das gleich!

---

<div class="post-metadata">

### Author: ![R4M](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/r4m/32/9983_2.png) [@R4M](https://forum.shopware.com/u/R4M)
#### Post date: [4. März 2022 um 13:17 UTC](https://forum.shopware.com/t/og-image-bild-fuer-facebook/93258/6 "2022-03-04T13:17:42Z")

</div>

> [@tp11](#):
>
> `frontend_index_header_meta_tags_opengraph`

ja klar, wenn du in einen Block nur das Bild nimmst, ist der Rest weg. Das reicht nicht damit das richtig erkannt wird.

PS: Facebook bemängelt übrigens hier auch, dass keine Bildgröße übergeben wird. Ich persönlich habe da noch

```auto
<meta property="og:image:width" content="1200px" />
<meta property="og:image:height" content="630px" />

```

mit eingebaut.

---

<div class="post-metadata">

### Author: ![tp11](https://avatars.discourse-cdn.com/v4/letter/t/e9c0ed/32.png) [@tp11](https://forum.shopware.com/u/tp11)
#### Post date: [4. März 2022 um 13:25 UTC](https://forum.shopware.com/t/og-image-bild-fuer-facebook/93258/7 "2022-03-04T13:25:24Z")

</div>

OK Danke, dann wäre das hier mein Inhalt der header.tpl

```auto
{extends file="parent:frontend/index/header.tpl"}
    {block name='frontend_index_header_meta_tags_opengraph'}
        <meta property="og:type" content="website" />
        <meta property="og:site_name" content="{{config name="sShopname"}|escapeHtml}" />
        <meta property="og:title" content="{{config name="sShopname"}|escapeHtml}" />
        {s name="IndexMetaDescriptionStandard" assign="snippetIndexMetaDescriptionStandard"}{/s}
        <meta property="og:description" content="{block name='frontend_index_header_meta_description_og'}	{$snippetIndexMetaDescriptionStandard|truncate:$SeoDescriptionMaxLength:'…'}{/block}" />
        <meta property="og:image" content="meinbild.png" />
	    <meta property="og:image:width" content="1200px" />
	    <meta property="og:image:height" content="630px" />
	    <meta name="twitter:card" content="website" />
        <meta name="twitter:site" content="{{config name="sShopname"}|escapeHtml}" />
        <meta name="twitter:title" content="{{config name="sShopname"}|escapeHtml}" />
        {s name="IndexMetaDescriptionStandard" assign="snippetIndexMetaDescriptionStandard"}{/s}
        <meta name="twitter:description" content="{block name='frontend_index_header_meta_description_twitter'}	{$snippetIndexMetaDescriptionStandard|truncate:$SeoDescriptionMaxLength:'…'}{/block}" />
        <meta name="twitter:image" content="{link file=$theme.desktopLogo fullPath}" />
    {/block}

```

Hoffe das klappt jetzt…

---

<div class="post-metadata">

### Author: ![R4M](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/r4m/32/9983_2.png) [@R4M](https://forum.shopware.com/u/R4M)
#### Post date: [4. März 2022 um 13:26 UTC](https://forum.shopware.com/t/og-image-bild-fuer-facebook/93258/8 "2022-03-04T13:26:31Z")

</div>

> [@tp11](#):
>
> `<meta property="og:image" content="meinbild.png" />`

Gibt hier unbedingt den kompletten Bildpfad an. Also mit URL vom Shop. Siehe dazu mein Beispiel. Das Bild muss von außerhalb so auch aufrufbar sein!

---

<div class="post-metadata">

### Author: ![tp11](https://avatars.discourse-cdn.com/v4/letter/t/e9c0ed/32.png) [@tp11](https://forum.shopware.com/u/tp11)
#### Post date: [4. März 2022 um 13:30 UTC](https://forum.shopware.com/t/og-image-bild-fuer-facebook/93258/9 "2022-03-04T13:30:36Z")

</div>

Hallo, ja danke, habe ich. Cache geleert… Shop läuft noch. 🙂  
lt. dem Tool [Sharing Debugger - Facebook for Developers](https://developers.facebook.com/tools/debug/)

zeit FB noch die alten Daten an. Aber irgendwo habe ich gelesen, dass hier das FB Caching da Problem ist… man kann es irgendwo neu anwerfen…,

Besten Dank!

---

<div class="post-metadata">

### Author: ![R4M](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/r4m/32/9983_2.png) [@R4M](https://forum.shopware.com/u/R4M)
#### Post date: [4. März 2022 um 13:37 UTC](https://forum.shopware.com/t/og-image-bild-fuer-facebook/93258/10 "2022-03-04T13:37:15Z")

</div>

> [@tp11](#):
>
> man kann es irgendwo neu anwerfen

Ja direkt beim FB Developer

---

<div class="post-metadata">

### Author: ![tp11](https://avatars.discourse-cdn.com/v4/letter/t/e9c0ed/32.png) [@tp11](https://forum.shopware.com/u/tp11)
#### Post date: [4. März 2022 um 14:03 UTC](https://forum.shopware.com/t/og-image-bild-fuer-facebook/93258/11 "2022-03-04T14:03:52Z")

</div>

Besten Dank nochmals an R4M!

Wollte das so erledigen, weil Plugins (ein SEO Plugin gibt es dafür ) teils viel zu aufgeladen sind… und für mich ein zu großes Risiko für andere Probleme sind.

Anbei nochmals der Code für alle die nicht laufend am coden sind.

```auto
{extends file="parent:frontend/index/header.tpl"}
    {block name='frontend_index_header_meta_tags_opengraph'}
        <meta property="og:type" content="website" />
        <meta property="og:site_name" content="{{config name="sShopname"}|escapeHtml}" />
        <meta property="og:title" content="{{config name="sShopname"}|escapeHtml}" />
        {s name="IndexMetaDescriptionStandard" assign="snippetIndexMetaDescriptionStandard"}{/s}
        <meta property="og:description" content="{block name='frontend_index_header_meta_description_og'}	{$snippetIndexMetaDescriptionStandard|truncate:$SeoDescriptionMaxLength:'…'}{/block}" />
        <meta property="og:image" content="https://www.meinedomain.at/media/image/f9/9s/2b/bild.png" />
	    <meta property="og:image:width" content="1200px" />
	    <meta property="og:image:height" content="630px" />
	    <meta name="twitter:card" content="website" />
        <meta name="twitter:site" content="{{config name="sShopname"}|escapeHtml}" />
        <meta name="twitter:title" content="{{config name="sShopname"}|escapeHtml}" />
        {s name="IndexMetaDescriptionStandard" assign="snippetIndexMetaDescriptionStandard"}{/s}
        <meta name="twitter:description" content="{block name='frontend_index_header_meta_description_twitter'}	{$snippetIndexMetaDescriptionStandard|truncate:$SeoDescriptionMaxLength:'…'}{/block}" />
        <meta name="twitter:image" content="{link file=$theme.desktopLogo fullPath}" />
    {/block}

```

Lg T
