如何在Django中为我的网站构建添加社交共享功能。我在SO中看到了一个类似的问题,但没有帮助(下面我解释了原因?),6年前有人问我,我想这些年后肯定有更好的方法。你知道吗
我试过使用addthis,它既优雅又易于使用,但当我在Facebook上分享帖子时,这就是问题所在。你知道吗
而且它也没有统计分享一个帖子的次数。你知道吗
我还尝试了其他的ways要么我不明白,要么效果不好。 请帮我做这个。非常感谢你。你知道吗
编辑:
我得到这个错误。添加<a href="https://www.facebook.com/sharer/sharer.php?u={{ request.get_full_path|urlencode }}&t={{ object.title }}">Share on Facebook</a>
后
将此用于Facebook:
{% with base_url="http://example.com" %} <a href="https://www.facebook.com/sharer/sharer.php?u={{ base_url|urlencode }}{{ request.get_full_path|urlencode }}&t={{ object.title }}">Share on Facebook</a> {% endwith %}
对于Twitter:
{% with base_url="http://example.com" %} <a href="https://twitter.com/share?text={{ user.username }}&url={{ base_url|urlencode }}{{ request.get_full_path|urlencode}}">Share on Twitter</a> {% endwith %}
对于Linkedin:使用this
相关问题 更多 >
编程相关推荐