1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Facebook OpenGraph Image from [img] or [attach] tags 1.3

Use the first image found in a [img] or [attach] tag to populate the og:image field

  1. JulianD

    JulianD Well-Known Member

    JulianD submitted a new resource:

    OpenGraph Image from [img ] or [ attach] tags - Use the first image found in a [ img] or [ attach] tag to populate the og:image field

    Read more about this resource...
     
    Last edited: Aug 12, 2013
  2. iface.vn

    iface.vn Member

    thanks so much.
    I testing.
     
  3. KC2T

    KC2T Member

    I tested and found the following:
     

    Attached Files:

    • 46.png
      46.png
      File size:
      122.4 KB
      Views:
      138
    • 47.png
      47.png
      File size:
      202.4 KB
      Views:
      129
  4. KC2T

    KC2T Member

  5. optimus

    optimus Member

    By 1 week facebook take my first image from post by default if there are no image in post it take default opengraph image, you don't need an addont for this, I think facebook make some change in opengraph algorithm.

    edit:
    Open Graph Warnings That Should Be Fixed
    Inferred Property:The 'og:description' property should be explicitly provided, even if a value can be inferred from other tags.
    og:image should be larger:provided og:image is not big enough. Please use an image that's at least 200x200 px. Image '***this is and external image url /first image from post which is bigger than 200x200 ***' will be used instead.

    So if in first post you have an image much largest than 200x200x facebook will take it automaticaly.
     
    Last edited: Aug 12, 2013
  6. Rho Delta

    Rho Delta Well-Known Member

    Great idea... any feedback on how well this works though?
     
  7. JulianD

    JulianD Well-Known Member

    I'm sorry but I can't understand your screenshot. Can you give me the URL to your test board?
     
  8. JulianD

    JulianD Well-Known Member

    If your find it useful, please try it on your forums and post your feedback :) That will help me update the addon :)
     
  9. JulianD

    JulianD Well-Known Member

    It doesn't seem to work like this to me. Facebook will always choose the same static image specified in the style properties. I'm glad it's been working fine to you though :)
     
  10. KC2T

    KC2T Member

  11. JulianD

    JulianD Well-Known Member

    Oh, I see what is going on.

    1) Do you have a Facebook Application ID or a Facebook Page Admin defined in Options > Facebook Integration? If you don't, XenForo doesn't include the open graph meta data.
    2) The first image doesn't work because you don't allow guest to download attachments
    3) When you attached an image to the post, it is not enough for the addon to work. You have to actually insert an [attach ] tag to the message of the post.

    I'm going to release an update to try to avoid an attached image if you don't allow guest to see attachments.
     
    Andy.N and KC2T like this.
  12. KC2T

    KC2T Member

    Thank you replied enthusiastically.
    I will look forward to your next version to the most recent one day.
     
  13. DRE

    DRE Well-Known Member

    This seems to only work when post a direct link. Doesn't work when using url shortening services.

    Not your fault but still... (n)
     
  14. DRE

    DRE Well-Known Member

    is there a way to force it to use only img or attach tags from a shortened url?

    For instance, if your twitter goes to your Facebook and you post a link to your twitter, the img and attach tags do not work.
     
  15. optimus

    optimus Member

    Is working somehow but, you need to make some change in you open_graph_meta Template, than will be first image
    So your open_graph_meta should look like it.
     
    Last edited: Aug 19, 2013
  16. JulianD

    JulianD Well-Known Member

    I don't know how to work that out since Facebook is the one taking such decisions.
    Thanks for the suggestion. Makes sense!
     
  17. DRE

    DRE Well-Known Member

    I put your code above the avatar code and it is now registering the image or attachment first instead of an avatar.
     
  18. JulianD

    JulianD Well-Known Member

    Brandon Sheley and KC2T like this.
  19. optimus

    optimus Member

    sinful likes this.
  20. Dinh Thanh

    Dinh Thanh Well-Known Member

    In some posts, users don't insert attachment images to post content. So could you also handle this case?
     

Share This Page