I had this working yesterday on a page, the requirement has now changed and they would like this share functionality to be on the thank you page, so I have moved the code over to that new page, this is the meta part of the page. The title and image get set dynamically via the model passed in, which I don't believe is causing the issue
@section metas{
<meta property="og:title" content="@Model.YoghurtTitle" />
<meta property="og:description" content="Check out the flavour I have just created!" />
<meta property="og:image" content="http://ift.tt/1DQj5ud" />
<meta property="og:url" content="http://ift.tt/1FqcwLU" />
}
This is my current set up of the share button
<div class="col-sm-6">
<div class="row col-lg-12 text-center danoneBlue">
<div class="fb-share-button" data-href="http://ift.tt/1FqcwLU" data-layout="button"></div>
</div>
</div>
and the script
<div id="fb-root"></div>
@section scripts{
<script>
(function (d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.0";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
}
and when I right click view source on the page this is what I see in the head section
<meta property="og:title" content="Check out the flavour I just made! Cool Yoghurt" />
<meta property="og:description" content="Check out the flavour I have just created!" />
<meta property="og:image" content="http://ift.tt/1DQj5ug" />
<meta property="og:url" content="http://ift.tt/1FqcwLU" />
Everything looks correct. Yet when I run the facebook debugger on the following URL http://ift.tt/1FqcwLU
I get errors which are as follows:
- Object at URL 'http://ift.tt/1DQj5ui' of type 'website' is invalid because a required property 'og:title' of type 'string' was not provided.
I have no idea where its getting flavour lab from, yes the script was on that page before but its now been moved and updated via Facebook Developer Plugin Share and now lives on the thank you page.
Aucun commentaire:
Enregistrer un commentaire