Skip to main content

Templatetags for 'tweet this' and 'share on facebook'

Project description

Provides tempatetags for ‘Tweet This’ and ‘Share this on Facebook’

INSTALLED_APPS += ['django_social_share']
{% post_to_facebook <text_to_post> <object_or_url> <link_text> %}

<text_to_post> may contain any valid Django Template code.

<object_or_url> is optional. If you pass a django model instance, it will use its get_absolute_url method. Additionally, if you have django_bitly installed, it will use its shortUrl on Twitter.

<link_text> is also optional. It defines the text used for the a element. Defaults to ‘Post to Facebook’ and ‘Post to Twitter’

Example:

{% load social_share %}

{% post_to_facebook "New Song: {{object.title}}. Check it out!" object_or_url "Post to Facebook!" %}
{% post_to_twitter "New Song: {{object.title}}. Check it out!" object_or_url "Post to Twitter" %}

Templates are in django_social_share/templatetags/post_to_twitter.html and django_social_share/templatetags/post_to_facebook.html. You can override them to suit your mileage.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-social-share-0.0.3.tar.gz (2.6 kB view details)

Uploaded Source

File details

Details for the file django-social-share-0.0.3.tar.gz.

File metadata

File hashes

Hashes for django-social-share-0.0.3.tar.gz
Algorithm Hash digest
SHA256 eeef0a0a569a21f5967648de32d3cc8b1afd72bfead44a5dbbe15e44f5519ea0
MD5 810cae671e82ee9d0303b57019121317
BLAKE2b-256 80745ec095fae3a5c0f605e12446b6913741b64a64d08d88ae5769fe3a5c9cb4

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page