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

Facebook share image selection

Discussion in 'XenForo Questions and Support' started by ibenick, Mar 13, 2012.

  1. ibenick

    ibenick Active Member

    Yes, I know this topic has been discussed, many, many times. But I have what I think is an odd predicament, not sure how to resolve it.

    A couple months ago, I found some instruction somewhere here on the XF boards to make it so that instead of grabbing my site logo image for Facebook thumbnails, it would let the user pick an image. That worked great. The problem now is that for some reason, Facebook is only seeing images when they are linked to the thread from outside of my site. So if someone posts photos that are hosted from Flickr, the images show up on Facebook. But if they uploaded them to my site, absolutely nothing comes up on Facebook, not even the site logo.

    I don't know what changed that broke the functionality as it was all working a few weeks ago. I figure I need to determine what changes I made before in order to get to the root of the problem but I cannot for the life of me find it. I've found a few threads that detail solutions that might work for me but when I check my templates, the code does not match.

    Specifically, I thought this template edit by @Jake Bunce might have been the one I used but neither the original or modified code is in my thread_view template.

    http://xenforo.com/community/thread...humbnail-for-facebook-feed.18284/#post-237150

    Any ideas on how I can fix this?

    Thanks.

    Thread example with photos uploaded to my site (no thumbnails on FB):
    http://backcountrypost.com/forum/threads/coal-pits-wash-the-chinle-trail.517/

    Thread example with linked photos from Flickr (lots of thumbnails to choose from):
    http://backcountrypost.com/forum/threads/moab-february-2012.505/
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    The page has no og information in the head. That might be it.

    The og information will only be included if you have entered an app id or admin:

    Admin CP -> Home -> Options -> Facebook Integration
     
    BassMan likes this.
  3. ibenick

    ibenick Active Member

    Hi Jake.

    I do have that information setup with my app ID. And if I were to just post my forum index in Facebook, it comes up with my pretermined OG image.

    Example:
    http://backcountrypost.com/forum/

    shows one possible thumbnail.
     
  4. Rho Delta

    Rho Delta Well-Known Member

    I would also love to have facebook pull images from threads when sharing rather than my facebook share logo.
     
    Crazyfruitbat, Bram and sforum like this.
  5. sforum

    sforum Active Member

    Same here! This is what happened when someone shared a thread on my old PunBB forum - Facebook would scan the link, and any images it found therein (i.e. any avatars, or images posted within the thread) would be listed as possible thumbnails to choose to display on Facebook.

    It would be great if I could once again do this since migrating to XenForo. :)
     
  6. ibenick

    ibenick Active Member

    Yes. Like many, I absolutely can't believe this isn't a 4-alarm fire for XenForo to add to the core functionality. Half of the coolness of posting a link on Facebook is the fact that a little preview shows up next to it. People need that visual stimulation! Social networking is critical in promoting growth for any forum. Perhaps a lot of forums don't have many photos as a key part of their content, but for those that do, this is a should be a quick deal breaker.

    So back to trying to at least get my setup back to the default of showing the crappy site thumbnail...

    Jake, do you know where I should look to find out why it's not even showing the OG thumbnail?
     
    Bram likes this.
  7. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    The og:image and other og information will only be included in the page if you have entered an app id or admin in the facebook settings:

    Admin CP -> Home -> Options -> Facebook Integration

    Otherwise no og information will be shown.

    In addition to this, if you wish to choose an image from the page at the time of sharing the link then you need to remove the og:images from this template:

    Admin CP -> Appearance -> Templates -> open_graph_meta

    Code:
    <xen:if is="{$xenOptions.facebookAppId} OR {$xenOptions.facebookAdmins}">
    	<meta property="og:site_name" content="{$xenOptions.boardTitle}" />
    	<xen:if is="{$avatar}"><meta property="og:image" content="{$avatar}" /></xen:if>
    	<meta property="og:image" content="{xen:helper fullurl, @ogLogoPath, 1}" />
    	<meta property="og:type" content="article" />
    	<meta property="og:url" content="{xen:raw $url}" />
    	<meta property="og:title" content="{xen:raw $title}" />
    	<xen:if is="{$xenOptions.facebookAppId}"><meta property="fb:app_id" content="{$xenOptions.facebookAppId}" /></xen:if>
    	<xen:if is="{$xenOptions.facebookAdmins}"><meta property="fb:admins" content="{xen:helper implode, {$xenOptions.facebookAdmins}, ','}" /></xen:if>
    </xen:if>
    
    It should allow you to choose an image when no og:image is defined (so I'm told, but I don't use facebook).
     
    BassMan, Myke623 and ARSamo like this.
  8. ibenick

    ibenick Active Member

    That template mod would be great. The problem is, I already changed something a couple months ago and I can't figure out what I changed.

    When I post a thread to FB with photos hosted OUTSIDE of my XenForo install, it lets me choose the photo. Anything that users uploaded directly into XF, no longer appears as of a few weeks ago.

    So any ideas where I might find how to at least revert to the standard crappy way of handling thumbnails on FB that XF does out of the box so that I can then try that mod? I've searched and searched and I can't find the template edit that I made before.

    Isn't it clear that many XF admins are desperate for this functionality? I can think of nothing I would like added to the core functionality more. Why isn't this being addressed by XF?
     
  9. ibenick

    ibenick Active Member

    Thinking more about this. I'm pretty sure the functionality broke when I changed to full friendly URLs. Is Facebook not seeing them because of that perhaps? Any ideas on how to get around that? I love the full friendly URLs but without the facebook images it's got to go.
     
  10. ibenick

    ibenick Active Member

    My suspicion is now confirmed. Full friendly URLs breaks whatever mod I made to allow facebook users to choose the thumbnail from the thread. I turned them off and everything is working fine. So I guess the big question now is how to make full friendly URLs work and still keep my Facebook thumbnails rocking.
     
    ARSamo, gordy and erich37 like this.
  11. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    That's interesting. This might be worth a bug report so the devs can take a look.
     
    gordy likes this.
  12. ibenick

    ibenick Active Member

    I imagine this won't be thought of as a bug since you have to alter the code to make the FB images have choices. :(
     
  13. gordy

    gordy Well-Known Member

    Yes extremely annoying, FURLS for attached images is definitely a must. I do not need the hashing obscurity for security at least an option for those who aren't worried about guests viewing images.
     
    Bram and ibenick like this.

Share This Page