We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

FaceBook Open Graph - Images

How Do I?

's avatar
3 posts
about 2 months ago
's avatar

Im trying to post an entry to FaceBook and I cant seem to get the image to display. My code looks like this:

{exp:channel:entries channel="news" limit="1" status="open" require_entry="yes" orderby="date" sort="desc" disable="categories|category_fields|member_data|trackbacks" dynamic="yes" show_future_entries="yes" show_expired="yes"}

<meta property="og:image" content="{images limit="1"}{image}{/images}">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta property="og:image:alt" content="alt">
<meta name="og:title" content="News - {title}">
<meta property="og:url" content="url-here">
<meta property="og:type" content="article">
<meta name="description" property="og:description" content="description"> 

{/exp:channel:entries}

When I run the url through the FaceBook share debugger I get this error:

The ‘og:image’ property should be explicitly provided, even if a value can be inferred from other tags.

I just dont know where the problem lies. Any help greatfully accepted.

Paul

       
lincolnpixel's avatar
lincolnpixel
83 posts
about 2 months ago
lincolnpixel's avatar lincolnpixel

Hi Paul,

Can you clearify if your image is in a Grid Field?

       
's avatar
3 posts
about 2 months ago
's avatar

Yes, Its in a grid field.

       
lincolnpixel's avatar
lincolnpixel
83 posts
about 2 months ago
lincolnpixel's avatar lincolnpixel

Grid field are accessed via a variable pair, so in your case..

<meta property="og:image" content="{images limit="1"}{images:image}{/images}">
       
's avatar
3 posts
about 2 months ago
's avatar

Im sorry. Its a Matrix field.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.