• 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...

Jaxel

Well-known member
#1

Jaxel

Well-known member
#3
You need to pass it a $url value (generated with "canonical").
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
 

Mike

XenForo developer
Staff member
#4
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>
 

Jaxel

Well-known member
#7
I'm not sure - there's nothing jumping out to me.
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.
 

Mike

XenForo developer
Staff member
#8
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.
 

Jaxel

Well-known member
#9
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>