More in this section

Forums / Developing with Sitefinity / How to choose the default image to show for a Facebook Like and Share buttons?

How to choose the default image to show for a Facebook Like and Share buttons?

3 posts, 0 answered
  1. xor
    xor avatar
    42 posts
    04 Jan 2010
    29 Jun 2012
    Link to this post

    I am using the facebook like and share buttons on my Sitefinity news item widget.

    The Og:image meta tag is what Facebook uses to identity the image of the web page which will show as a thumbnail whenever it shows the web page's link anywhere.

    If you don't use this meta tag, then facebook will try to read the web page and identify some of the images which could be shown as a thumbnail and it might select an image which might not be the best image which I would like it to show up with the link (news item).

    Can I add a custom field for the thumbnail in the news widget and make use of it to update the meta tag?

    Thanks for whatever pointers anyone can give me.
    Fadi Raheel
  2. Rick
    Rick avatar
    7 posts
    23 Jul 2012
    08 Nov 2012
    Link to this post
    I'd like to know this as well.  We also have a need to apply the og:image meta tag to multiple pages.  It would be nice to define some default values in one place...Then have "overrides" per page and the rest of the FB meta taga ideally auto-generate by using the page properties.
  3. Patrick Dunn
    Patrick Dunn avatar
    237 posts
    03 Nov 2014
    13 Nov 2012
    Link to this post

     Take a look at this article which discusses how to set multiple images on the og: tag for the facebook share utility. Most importantly take a look at this solution:

    The og:image meta tag you are using is called by Facebook's servers after the user clicks your share button. So if you are trying to change this and have the person click the share button, this won't work. If you want to support multiple og:images on your page you could use different query parameters for each image.

    For example: would render the metatag like

    <meta property="og:image" content="" /> 

    Then you could also have for example:
    that would render the metatag like

    <meta property="og:image" content="" /> 

    Another way you could do this is would just be to ask the user for stream_publish permission and use the Graph API to send the post directly to facebook yourself. You can find out more about this approach here:

    Let me know if this doesn't clear things up.

    Kind regards,
    Patrick Dunn
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
3 posts, 0 answered