Contrib Post Types
tumblelog’s contrib module provides a number of ready-made post types.
Article
A post type representing a long-form text post
- Location:
- tumblelog.contrib.text.Article
- Extends:
- BasePostType
Fields
- body - the full text of the article
- excerpt - a short excerpt of the body, intended to be used in post listing views
Flickr
An oEmbed post type </oembed> for the Flickr image hosting service.
- Location:
- tumblelog.contrib.photo.Flickr
- Extends:
- BaseOembedPhoto
Fields
- flickr_url - the URL of the Flickr photo
Properties
- flickr_title - Flickr’s title for the image
- flickr_user - The Flickr uploader’s username
- flickr_user_url - The URL to the Flickr uploader’s photostream
- image_url - URL of the image
- width - width of the image located at image_url
- height - height of the image located at image_url
File
A post type for a downloadable file.
- Location:
- tumblelog.contrib.code.File
- Extends:
- BasePostType
Fields
- file_file - the uploaded file
- file_name - a descriptive name of the file
- description - a longer description of the file
Properties
- file_link_text - returns the value of the file_name field if specified; otherwise returns the filename.
Gist
An oEmbed post type </oembed> for GitHub’s Gist code snippet service.
- Location:
- tumblelog.contrib.code.Gist
- Extends:
- BaseOembedRich
Fields
- gist_url - the URL of the Gist to embed
Properties
- gist_title - Gist’s title for snippet
- embed - the snippet’s plain HTML embed code
- git_user - the author’s GitHub username
- git_user_url - the URL to the author’s GitHub profile
- gist_id - GitHub’s ID for the Gist
- javascript_embed - embed code for Gist’s more robust JavaScript embed, using the plain HTML embed code returned by oEmbed as a <noscript> fallback.
Image
A post type for an image file.
- Location:
- tumblelog.contrib.photo.Image
- Extends:
- BasePostType
Fields
- image - the uploaded image
- caption - a longer caption of the image
Properties
- file_link_text - returns the value of the file_name field if specified; otherwise returns the filename.
Instagram
An oEmbed post type </oembed> for the Instagram image sharing service.
- Location:
- tumblelog.contrib.photo.Instagram
- Extends:
- BaseOembedPhoto
Fields
- instagram_url - the URL of the Instagram photo
Properties
- instagram_title - Instagram’s title for the image
- instagram_user - The Instagram uploader’s username
- image_url - URL of the image
- width - width of the image located at image_url
- height - height of the image located at image_url
Link
A post type for a link to an external site.
- Location:
- tumblelog.contrib.link.Link
- Extends:
- BasePostType
Fields
- link - a URL to an external site
- link_text - text used by the link
- caption - a longer caption describing the link
Rdio
An oEmbed post type </oembed> for the Rdio streaming music service. Can be used to embed an album, track, or playlist.
- Location:
- tumblelog.contrib.audio.Rdio
- Extends:
- BaseOembedRich
Fields
- rdio_url - the URL of the Rdio resource
Properties
- rdio_title - Rdio’s title for the resource
- embed - the resource’s embed code
- width - the width of the embed
- height - the height of the embed
- thumbnail.url - the URL of a thumbnail image
- thumbnail.width - an integer indicating the width of the thumbnail image
- thumbnail.height - an integer indicating the height of the thumbnail image
SoundCloud
An oEmbed post type </oembed> for the SoundCloud audio sharing service. Can be used to embed a track, set, group, or user.
- Location:
- tumblelog.contrib.audio.SoundCloud
- Extends:
- BaseOembedRich
Fields
- soundcloud_url - the URL of the Rdio resource
- maxwidth - the maximum allowable width for embeds
- maxheight - for SoundCloud tracks, defines the height of the returned player.
- color - a hex triplet used as an accent color in the SoundCloud embed
- auto_play - a boolean indicating whether the embed should automatically play on load
- show_comments - a boolean indicating whether SoundCloud’s timed comments should be included in the embed
- html5_player - a boolean indicating whether SoundCloud’s HTML5 player should be used by the embed
Properties
- soundcloud_title - SoundCloud’s title for the resource
- soundcloud_description - SoundCloud’s description of the resource
- embed - the resource’s embed code
- width - the width of the embed
- height - the height of the embed
Text
A post type representing a short text post
- Location:
- tumblelog.contrib.text.Text
- Extends:
- BasePostType
Fields
- body - the full text of the post
Vimeo
An oEmbed post type </oembed> for the Vimeo video hosting service.
- Location:
- tumblelog.contrib.video.Vimeo
- Extends:
- BaseOembedVideo
Fields
- vimeo_url - the URL of the video to embed
Properties
- vimeo_title - Vimeo’s title for snippet
- embed - the video’s embed code
- vimeo_user - the author’s Vimeo username
- vimeo_user_url - the URL to the author’s Vimeo profile
- vimeo_video_id - Vimeo’s ID for the video
- duration - the length of the embedded video, in seconds
- thumbnail.url - the URL of a thumbnail image
- thumbnail.width - an integer indicating the width of the thumbnail image
- thumbnail.height - an integer indicating the height of the thumbnail image
YouTube
An oEmbed post type </oembed> for the YouTube video hosting service.
- Location:
- tumblelog.contrib.video.YouTube
- Extends:
- BaseOembedVideo
Fields
- youtube_url - the URL of the video to embed
Properties
- youtube_title - YouTube’s title for snippet
- embed - the video’s embed code
- youtube_user - the author’s YouTube username
- youtube_user_url - the URL to the author’s YouTube profile
- thumbnail.url - the URL of a thumbnail image
- thumbnail.width - an integer indicating the width of the thumbnail image
- thumbnail.height - an integer indicating the height of the thumbnail image