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

Weird facebook share_page error...

Discussion in 'XenForo Development Discussions' started by Jaxel, Feb 25, 2011.

  1. Jaxel

    Jaxel Well-Known Member

  2. Mike

    Mike XenForo Developer Staff Member

    You need to pass it a $url value (generated with "canonical").
     
  3. Jaxel

    Jaxel Well-Known Member

    I thought the $url was generated automatically... It's working for the twitter button, but not the facebook. I'm not passing any value for twitter; why would it work with twitter and not facebook? As well, I'm not passing an $url value on ANY of my pages... why is it working with some and not others? I am using $this->canonicalizeRequestUrl() in all pages.

    If I do pass $url, it still doesn't work... so I dotn think thats the issue
     
  4. Mike

    Mike XenForo Developer Staff Member

    That would really be down to their APIs and how they handle not being given a URL, so I'm not sure. In every case we do the sharing buttons, we set $url as necessary:
    Code:
    			<xen:include template="sidebar_share_page">
    				<xen:set var="$url">{xen:link canonical:members, $user}</xen:set>
    			</xen:include>
     
  5. Jaxel

    Jaxel Well-Known Member

  6. Mike

    Mike XenForo Developer Staff Member

    I'm not sure - there's nothing jumping out to me.
     
  7. Jaxel

    Jaxel Well-Known Member

    but do you at least see what I'm talking about? The way the button flickers? Looking on my facebook, it doesn't post the recommend. The button is working on other pages without any issues; its just specifically media pages.
     
  8. Mike

    Mike XenForo Developer Staff Member

    Oh actually, I think you might be missing some of the og tags that are necessary (admins or app ID). I recommend that you look at the conditions for how we output og tags now.
     
  9. Jaxel

    Jaxel Well-Known Member

    Yep... figured it out... as it turns out, Facebook can not handle the following OG:
    Code:
    <meta property="og:type" content="video" />
    The code below is how I am inserting tags, should I be doing it a different way?
    Code:
    <xen:container var="$head.video">
    	<link rel="canonical" href="{xen:link 'canonical:media', $media}" />
    	<link rel="image_src" href="{xen:link 'full:data/media/{$media.media_id}.jpg'}" />
    	<meta name="title" content="{$media.media_title}" />
    	<meta name="description" content="{$media.media_description}" />
    	<meta name="keywords" content="{$media.media_keywords}" />
    
    	<meta property="og:url" content="{xen:link 'canonical:media', $media}" />
    	<meta property="og:image" content="{xen:link 'full:data/media/{$media.media_id}.jpg'}" />
    	<meta property="og:title" content="{$media.media_title}" />
    	<meta property="og:description" content="{$media.media_description}" />
    	<meta property="og:keywords" content="{$media.media_keywords}" />
    </xen:container>
     
  10. Wuebit

    Wuebit Well-Known Member

    Did you get this working in the end Jaxel?
    My button also does the same yet twitter work's fine
     

Share This Page