admin管理员组文章数量:1322850
I have a question and answer section on my website and I am trying to integrate social media sharing into each question on the forum. I basically just want the user to be able to share the individual question on their timeline. I am currently using the sharer.php method, which I believe is no longer deprecated. See below:
window.open(".php?u=" + "" + fullHREF,"","height=550,width=525,left=100,top=100,menubar=0");
At this point, the facebook post content is my site title, and my site's home url...but the link DOES direct you to the individual question. In the facebook post I want: my pany logo, the question title, and a link to my site. What is the best way to acplish this? Sorry for the vague nature of the question, I am new to the relatively new to Facebook's API. I have been looking into Facebook's OpenGraph Stories, but I think that would be more appropriate for when a user answers a question on my site, and the story would read..Joe Blow ANSWERED a QUESTION on example. In this part of the site, I just want users to be able to share the question title. I would also like to have my pany logo as the image in the facebook post content...but no image is showing up right now, although I have an image defined in the og:image tag. Thanks in advance.
I have a question and answer section on my website and I am trying to integrate social media sharing into each question on the forum. I basically just want the user to be able to share the individual question on their timeline. I am currently using the sharer.php method, which I believe is no longer deprecated. See below:
window.open("https://www.facebook./sharer/sharer.php?u=" + "" + fullHREF,"","height=550,width=525,left=100,top=100,menubar=0");
At this point, the facebook post content is my site title, and my site's home url...but the link DOES direct you to the individual question. In the facebook post I want: my pany logo, the question title, and a link to my site. What is the best way to acplish this? Sorry for the vague nature of the question, I am new to the relatively new to Facebook's API. I have been looking into Facebook's OpenGraph Stories, but I think that would be more appropriate for when a user answers a question on my site, and the story would read..Joe Blow ANSWERED a QUESTION on example.. In this part of the site, I just want users to be able to share the question title. I would also like to have my pany logo as the image in the facebook post content...but no image is showing up right now, although I have an image defined in the og:image tag. Thanks in advance.
Share Improve this question edited Feb 16, 2016 at 2:34 programmingmusic asked Feb 16, 2016 at 2:28 programmingmusicprogrammingmusic 4891 gold badge4 silver badges13 bronze badges 2- fullHREF is dynamically created and is the url of the individual question to be shared. – programmingmusic Commented Feb 16, 2016 at 2:35
- developers.facebook./docs/sharing/webmasters#markup – C3roe Commented Feb 16, 2016 at 9:21
1 Answer
Reset to default 5The function you are looking for: https://developers.facebook./docs/sharing/reference/share-dialog
Make sure the parameters are correct.
For link problem, ensure the "fullHREF" is cleaned by urlencode(). Cos a "hash" would break the sharer function in my experience.
For the pany logo, use the debug tool: https://developers.facebook./tools/debug/sharing
You can scrape again to get the latest image you set in the meta tag. If it is still not showing the correct one, you might have the tag wrongly configured.
If you want to have dynamic image on the post, you should consider to use feed dialog: https://developers.facebook./docs/sharing/reference/feed-dialog
本文标签: javascriptCustom Facebook Share using SharerphpStack Overflow
版权声明:本文标题:javascript - Custom Facebook Share using Sharer.php - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742112416a2421313.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论