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 <object_or_url> <link_text> %}

{% post_to_twitter <text_to_post> <object_or_url> <link_text> %}

<text_to_post> may contain any valid Django Template code. Note that Facebook does not support this anymore.

<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 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.1.0.tar.gz (3.3 kB view details)

Uploaded Source

File details

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

File metadata

File hashes

Hashes for django-social-share-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d991811a68800c614cb755f6e85fd440bf01228db36cda090b2defc5e543d476
MD5 bc4da7e2d31632de4078723996f2591e
BLAKE2b-256 0fd42fe954a8a13ee40f52233d1577f511343a44ff2e35210cf6f59de4bcb0b3

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