Sunteți pe pagina 1din 16

Dashboard

Directory

Goodies

Account

Search Help

Creating a custom HTML theme


Tumblr lets you fully customize the appearance of your blog by editing your theme's HTML code. This is only recommended for users comfortable hand-coding HTML. If you're not, there are hundreds of great themes to choose from in the Theme Garden! Once you've created a theme you're proud of, submit it to the Theme Garden to share with everyone on Tumblr!

Contents
Introduction Basic Variables Navigation Pages Permalinks Jump Pagination Posts Reblogs Text Posts Photo Posts Photoset Posts Quote Posts Link Posts Chat Posts Audio Posts Video Posts Answer Posts Dates Notes Tags Group Blogs Members Posts Day Pages Tag Pages Search Following Likes Appearance Options Custom Colors Custom Fonts Booleans Custom Text Custom Images Custom CSS Twitter iPhone Themes Variable Transformations

Introduction
To start, click the "Customize" button on your Dashboard. Click the "Theme" tab, and click "Use custom HTML". This will bring up a text box with your current theme's HTML code. Tumblr has two types of special operators used to render content in your HTML. Variables are used to insert dynamic data like your blog's title or description:
<html> <head> <title>{Title}</title> </head> <body> ... </body> </html>

Blocks are either used to render a block of HTML for a set of data (like your posts), or to conditionally render a block of HTML (like a "Previous Page" link):
<html> <body> <ol id="posts"> {block:Posts} <li> ... </li> {/block:Posts} </ol> </body> </html>

Here's an example of the complete markup for a theme:


<html> <head> <title>{Title}</title> <link rel="shortcut icon" href="{Favicon}"> <link rel="alternate" type="application/rss+xml" href="{RSS}"> {block:Description} <meta name="description" content="{MetaDescription}" /> {/block:Description} </head> <body> <h1>{Title}</h1> {block:Description} <p id="description">{Description}</p> {/block:Description} <ol id="posts"> {block:Posts} {block:Text} <li class="post text"> {block:Title} <h3><a href="{Permalink}">{Title}</a></h3> {/block:Title} {Body} </li> {/block:Text} {block:Photo} <li class="post photo"> <img src="{PhotoURL-500}" alt="{PhotoAlt}"/> {block:Caption} <div class="caption">{Caption}</div> {/block:Caption} </li> {/block:Photo} {block:Photoset} <li class="post photoset">

{Photoset-500} {block:Caption} <div class="caption">{Caption}</div> {/block:Caption} </li> {/block:Photoset} {block:Quote} <li class="post quote"> "{Quote}" {block:Source} <div class="source">{Source}</div> {/block:Source} </li> {/block:Quote} {block:Link} <li class="post link"> <a href="{URL}" class="link" {Target}>{Name}</a> {block:Description} <div class="description">{Description}</div> {/block:Description} </li> {/block:Link} {block:Chat} <li class="post chat"> {block:Title} <h3><a href="{Permalink}">{Title}</a></h3> {/block:Title} <ul class="chat"> {block:Lines} <li class="{Alt} user_{UserNumber}"> {block:Label} <span class="label">{Label}</span> {/block:Label} {Line} </li> {/block:Lines} </ul> </li> {/block:Chat} {block:Video} <li class="post video"> {Video-500} {block:Caption} <div class="caption">{Caption}</div> {/block:Caption} </li> {/block:Video} {block:Audio} <li class="post audio"> {AudioPlayerBlack} {block:Caption} <div class="caption">{Caption}</div> {/block:Caption} </li> {/block:Audio} {/block:Posts} </ol> <p id="footer"> {block:PreviousPage} <a href="{PreviousPage}">&#171; Previous</a> {/block:PreviousPage} {block:NextPage} <a href="{NextPage}">Next &#187;</a> {/block:NextPage} <a href="/archive">Archive</a> </p> </body> </html>

Basic Variables
{Title} {Description} {MetaDescription} {RSS} {Favicon} {CustomCSS} The HTML-safe title of your blog. The description of your blog. (may include HTML) The HTML-safe description of your blog. (use in META tag) RSS feed URL for your blog. Favicon URL for your blog. Any custom CSS code added on your "Customize Theme"

screen. {block:PermalinkPage} {/block:PermalinkPage} {block:IndexPage} {/block:IndexPage} {block:PostTitle} {PostTitle} {/block:PostTitle} Rendered on post permalink pages. (Useful for embedding comment widgets) Rendered on index (post) pages.

Rendered on permalink pages. (Useful for displaying the current post's title in the page title) Example: <title>{Title}{block:PostTitle} - {PostTitle} {/block:PostTitle}</title>

{block:PostSummary} {PostSummary} {/block:PostSummary} {PortraitURL-16} {PortraitURL-24} {PortraitURL-30} {PortraitURL-40} {PortraitURL-48} {PortraitURL-64} {PortraitURL-96} {PortraitURL-128}

Identical to {PostTitle}, but will automatically generate a summary if a title doesn't exist.

Portrait photo URL for your blog. 16-pixels by 16-pixels. Portrait photo URL for your blog. 24-pixels by 24-pixels. Portrait photo URL for your blog. 30-pixels by 30-pixels. Portrait photo URL for your blog. 40-pixels by 40-pixels. Portrait photo URL for your blog. 48-pixels by 48-pixels. Portrait photo URL for your blog. 64-pixels by 64-pixels. Portrait photo URL for your blog. 96-pixels by 96-pixels. Portrait photo URL for your blog. 128-pixels by 128-pixels.

Navigation
{block:Pagination} {/block:Pagination} {block:PreviousPage} {/block:PreviousPage} {block:NextPage} {/block:NextPage} {PreviousPage} {NextPage} {CurrentPage} {TotalPages} {block:SubmissionsEnabled} {/block:SubmissionsEnabled} {SubmitLabel} Rendered if there is a "previous" or "next" page.

Rendered if there is a "previous" page (newer posts) to navigate to. Rendered if there is a "next" page (older posts) to navigate to. URL for the "previous" page (newer posts). URL for the "next" page (older posts). Current page number. Total page count. Rendered if Submissions are enabled.

The customizable label for the Submit link. (Example: "Submit") Rendered if asking questions is enabled.

{block:AskEnabled} {/block:AskEnabled} {AskLabel}

The customizable label for the Ask link. (Example: "Ask me anything")

Jump Pagination
{block:JumpPagination length="5"} {/block:JumpPagination} Rendered for each page greater than the current page minus one-half length up to current page plus one-half length . Rendered when jump page is the current page.

{block:CurrentPage} {/block:CurrentPage} {block:JumpPage} {/block:JumpPage} {PageNumber} {URL}


EXAMPLE

Rendered when jump page is not the current page.

Page number for jump page. URL for jump page.

<html> <body> ... {block:Pagination}

{block:PreviousPage} <a href="{PreviousPage}">Previous</a> {/block:PreviousPage} {block:JumpPagination length="5"} {block:CurrentPage} <span class="current_page">{PageNumber}</span> {/block:CurrentPage} {block:JumpPage} <a class="jump_page" href="{URL}">{PageNumber}</a> {/block:JumpPage} {/block:JumpPagination} {block:NextPage} <a href="{NextPage}">Next</a> {/block:NextPage} {/block:Pagination} </body> </html>

Pages
{block:HasPages} {/block:HasPages} {block:Pages} {/block:Pages} {URL} {Label} Rendered if you have defined any custom pages.

Rendered for each custom page. The URL for this page. The label for this page.

Permalink Navigation
{block:PermalinkPagination} {/block:PermalinkPagination} {block:PreviousPost} {/block:PreviousPost} {block:NextPost} {/block:NextPost} {PreviousPost} {NextPost} Rendered if there is a "previous" or "next" post.

Rendered if there is a "previous" post to navigate to.

Rendered if there is a "next" post to navigate to.

URL for the "previous" (newer) post. URL for the "next" (older) post.

Posts
{block:Posts} {/block:Posts} This block gets rendered for each post in reverse chronological order. The number of posts that appear perpage can be configured the the Customize area for the blog on the Advanced tab. Rendered for Text posts. Rendered for Photo posts. Rendered for Photoset posts.

{block:Text} {/block:Text} {block:Photo} {/block:Photo} {block:Photoset} {/block:Photoset} {block:Quote} {/block:Quote} {block:Link} {/block:Link} {block:Chat} {/block:Chat} {block:Audio} {/block:Audio} {block:Video} {/block:Video} {block:Answer} {/block:Answer} {Permalink}

Rendered for Quote posts. Rendered for Link posts. Rendered for Conversation posts. Rendered for Audio posts. Rendered for Video posts. Rendered for Answer posts. The permalink for a post. (Example: "http://sample.tumblr.com/post/123") A shorter URL that redirects to this post. (Example: "http://tumblr.com/xpv5qtavm") The numeric ID for a post. (Example: 1234567) An HTML class-attribute friendly list of the post's tags. (Example: "humor office new_york_city") By default, an HTML friendly version of the source domain of imported posts will be included. (Example: "twitter_com", "digg_com", etc.) This may not behave as expected with feeds like Del.icio.us that send their content URLs as their permalinks.

{ShortURL}

{PostID} {TagsAsClasses}

The class-attribute "reblog" will be included automatically if the post was reblogged from another post. {block:Post [1-15] } {/block:Post [1-15] } Rendered for the post at the specified offset. This makes it possible to insert an advertisement or design element in the middle of your posts. Example: {block:Post5}I'm the fifth post!{/block:Post5} will only be rendered on the fifth post being displayed. {block:Odd} {/block:Odd} Rendered for every one of the current pages odd-numbered posts. Rendered for every one of the current pages even-numbered posts. Rendered on index pages for posts with Read More breaks. URL to an HTML partial of this post's Notes. Useful for loading Notes via AJAX.

{block:Even} {/block:Even}

{block:More} {/block:More} {PostNotesURL}

Reblogs
{block:RebloggedFrom} {/block:RebloggedFrom} {ReblogParentName} {ReblogParentTitle} {ReblogParentURL} {ReblogParentPortraitURL-16} Rendered if a post was reblogged from another post.

The username of the blog this post was reblogged from. The title of the blog this post was reblogged from. The URL for the blog this post was reblogged from. Portrait photo URL for the blog this post was reblogged from. 16-pixels by 16-pixels. Portrait photo URL for the blog this post was reblogged from. 24-pixels by 24-pixels. Portrait photo URL for the blog this post was reblogged from. 30-pixels by 30-pixels. Portrait photo URL for the blog this post was reblogged from. 40-pixels by 40-pixels. Portrait photo URL for the blog this post was reblogged from. 48-pixels by 48-pixels. Portrait photo URL for the blog this post was reblogged from. 64-pixels by 64-pixels. Portrait photo URL for the blog this post was reblogged from. 96-pixels by 96-pixels. Portrait photo URL for the blog this post was reblogged from. 128-pixels by 128-pixels. The username of the blog this post was created by. The title of the blog this post was created by. The URL for the blog this post was created by. Portrait photo URL for the blog this post was created by. 16pixels by 16-pixels. Portrait photo URL for the blog this post was created by. 24pixels by 24-pixels. Portrait photo URL for the blog this post was created by. 30pixels by 30-pixels. Portrait photo URL for the blog this post was created by. 40pixels by 40-pixels. Portrait photo URL for the blog this post was created by. 48pixels by 48-pixels. Portrait photo URL for the blog this post was created by. 64pixels by 64-pixels. Portrait photo URL for the blog this post was created by. 96pixels by 96-pixels. Portrait photo URL for the blog this post was created by. 128-pixels by 128-pixels.

{ReblogParentPortraitURL-24}

{ReblogParentPortraitURL-30}

{ReblogParentPortraitURL-40}

{ReblogParentPortraitURL-48}

{ReblogParentPortraitURL-64}

{ReblogParentPortraitURL-96}

{ReblogParentPortraitURL-128}

{ReblogRootName} {ReblogRootTitle} {ReblogRootURL} {ReblogRootPortraitURL-16}

{ReblogRootPortraitURL-24}

{ReblogRootPortraitURL-30}

{ReblogRootPortraitURL-40}

{ReblogRootPortraitURL-48}

{ReblogRootPortraitURL-64}

{ReblogRootPortraitURL-96}

{ReblogRootPortraitURL-128}

Text Posts

{block:Title} {/block:Title} {Title} {Body}

Rendered if there is a title for this post. The title of this post. The content of this post.

Photo Posts
{PhotoAlt} The HTML-safe version of the caption (if one exists) of this post. Rendered if there is a caption for this post. The caption for this post. A click-through URL for this photo if set. An HTML open anchor-tag including the click-through URL if set. (Example: <a href="http://...">) A closing anchor-tag output only if a click-through URL is set. (Example: </a>) URL for the photo of this post. No wider than 500-pixels. URL for the photo of this post. No wider than 400-pixels. URL for the photo of this post. No wider than 250-pixels. URL for the photo of this post. No wider than 100-pixels. URL for a square version the photo of this post. 75-pixels by 75-pixels. URL for the high-res photo of this post. Rendered if there is high-res photo for this post.

{block:Caption} {/block:Caption} {Caption} {LinkURL} {LinkOpenTag}

{LinkCloseTag}

{PhotoURL-500} {PhotoURL-400} {PhotoURL-250} {PhotoURL-100} {PhotoURL-75sq}

{PhotoURL-HighRes} {block:HighRes} {/block:HighRes}

Photoset Posts
{block:Caption} {/block:Caption} {Caption} {Photoset-500} {Photoset-400} {Photoset-250} Rendered if there is a caption for this post. The caption for this post. Embed-code for the photoset. 500-pixels wide. Embed-code for the photoset. 400-pixels wide. Embed-code for the photoset. 250-pixels wide.

Quote Posts
{Quote} {block:Source} {/block:Source} {Source} {Length} The content of this post. Rendered if there is a source for this post. The source for this post. (May contain HTML) "short", "medium", or "long", depending on the length of the quote.

Link Posts
{URL} {Name} The URL of this post. The name of this post. Defaults to the URL if no name is entered. Should be included inside the A-tags of Link posts. Output target="_blank" if you've enabled "Open links in new window". Rendered if there is a description for this post.

{Target}

{block:Description} {/block:Description} {Description}

The description for this post.

Chat Posts
{block:Title} {/block:Title} {Title} Rendered if there is a title for this post. The title of this post.

{block:Lines} {/block:Lines} {block:Label} {/block:Label}

Rendered for each line of this post. Rendered if a label was extracted for the current line of this post. The label (if one was extracted) for the current line of this post. The username (if one was extracted) for the current line of this post. The current line of this post. A unique identifying integer representing the user of the current line of this post. "odd" or "even" for each line of this post.

{Label}

{Name}

{Line} {UserNumber}

{Alt}

Audio Posts
{block:Caption} {/block:Caption} {Caption} {AudioPlayer} {AudioPlayerWhite} {AudioPlayerGrey} {AudioPlayerBlack} {RawAudioURL} {PlayCount} {FormattedPlayCount} Rendered if there is a caption for this post. The caption for this post. Default audio player. White audio player. Grey audio player. Black audio player. URL for this post's audio file. iPhone Themes only. The number of times this post has been played. The number of times this post has been played, formatted with commas. (e.g. "12,309") The number of times this post has been played, formatted with commas and pluralized label (e.g. "12,309 plays") Rendered if this post uses an externally hosted MP3. (Useful for adding a "Download" link) The external MP3 URL, if this post uses an externally hosted MP3. Rendered if this audio file's ID3 info contains album art.

{PlayCountWithLabel}

{block:ExternalAudio} {/block:ExternalAudio} {ExternalAudioURL}

{block:AlbumArt} {AlbumArtURL} {/block:AlbumArt} {block:Artist} {Artist} {/block:Artist} {block:Album} {Album} {/block:Album} {block:TrackName} {TrackName} {/block:TrackName}

Rendered if this audio file's ID3 info contains the artist name.

Rendered if this audio file's ID3 info contains the album title.

Rendered if this audio file's ID3 info contains the track name.

Video Posts
{block:Caption} {/block:Caption} {Caption} {Video-500} {Video-400} {Video-250} Rendered if there is a caption for this post. The caption for this post. Embed-code for the content of this post. 500-pixels wide. Embed-code for the content of this post. 400-pixels wide. Embed-code for the content of this post. 250-pixels wide.

Answer Posts
{Question} The question for this post. (May contain heavily filtered HTML) The answer for this post. (May contain HTML) Simple HTML text link with the asker's username and URL, or the plain text string "Anonymous". Portrait photo URL for the asker. 16-pixels by 16-pixels.

{Answer} {Asker}

{AskerPortraitURL-16}

{AskerPortraitURL-24} {AskerPortraitURL-30} {AskerPortraitURL-40} {AskerPortraitURL-48} {AskerPortraitURL-64} {AskerPortraitURL-96} {AskerPortraitURL-128}

Portrait photo URL for the asker. 24-pixels by 24-pixels. Portrait photo URL for the asker. 30-pixels by 30-pixels. Portrait photo URL for the asker. 40-pixels by 40-pixels. Portrait photo URL for the asker. 48-pixels by 48-pixels. Portrait photo URL for the asker. 64-pixels by 64-pixels. Portrait photo URL for the asker. 96-pixels by 96-pixels. Portrait photo URL for the asker. 128-pixels by 128-pixels.

Dates
{block:Date} {/block:Date} Rendered for all posts.
Always wrap dates in this block so they will be properly hidden on non-post pages.

{block:NewDayDate} {/block:NewDayDate} {block:SameDayDate} {/block:SameDayDate} {DayOfMonth} {DayOfMonthWithZero} {DayOfWeek} {ShortDayOfWeek} {DayOfWeekNumber} {DayOfMonthSuffix} {DayOfYear} {WeekOfYear} {Month} {ShortMonth} {MonthNumber} {MonthNumberWithZero} {Year} {ShortYear} {AmPm} {CapitalAmPm} {12Hour} {24Hour} {12HourWithZero} {24HourWithZero} {Minutes} {Seconds} {Beats} {Timestamp} {TimeAgo}

Rendered for posts that are the first to be listed for a given day. Rendered for subsequent posts listed for a given day.

"1" to "31" "01" to "31" "Monday" through "Sunday" "Mon" through "Sun" "1" through "7" "st", "nd", "rd", "th" "1" through "365" "1" through "52" "January" through "December" "Jan" through "Dec" "1" through "12" "01" through "12" "2007" "07" "am" or "pm" "AM" or "PM" "1" through "12" "0" through "23" "01" through "12" "00" through "23" "00" through "59" "00" through "59" "000" through "999" "1172705619" A contextual time. ("1 minute ago", "2 hours ago", "3 weeks ago", etc.)

Notes
Notes include posts' reblogs, likes, and answers.
{block:PostNotes} {/block:PostNotes} {PostNotes} Rendered on permalink pages this post has notes.

Standard HTML output of this post's notes. Only rendered on permalink pages.

{block:NoteCount} {/block:NoteCount}

Rendered if this post has notes.


Always wrap note counts in this block so they will be properly hidden on non-post pages.

{NoteCount} {NoteCountWithLabel}

The number of this post's notes. The number of this post's notes with pluralized label. (e.g. "24 notes")

EXAMPLE

<html> <head> <style type="text/css"> ol.notes { padding: 0px; margin: 25px 0px; list-style-type: none; border-bottom: solid 1px #ccc; } ol.notes li.note { border-top: solid 1px #ccc; padding: 10px; } ol.notes li.note img.avatar { vertical-align: -4px; margin-right: 10px; width: 16px; height: 16px; } ol.notes li.note span.action { font-weight: bold; } ol.notes li.note .answer_content { font-weight: normal; } ol.notes li.note blockquote { border-color: #eee; padding: 4px 10px; margin: 10px 0px 0px 25px; } ol.notes li.note blockquote a { text-decoration: none; } </style> </head> <body> {block:Posts} ... {PostNotes} {/block:Posts} </body> </html>

Notes are paginated with AJAX. If your theme needs to manipulate the Notes markup or DOM nodes, you can add a Javascript callback that fires when a new page of Notes is loaded or inserted:
tumblrNotesLoaded(notes_html) If this Javascript function is defined, it will be triggered when a new page of Notes is loaded and ready to be inserted. If this function returns false , it will block the Notes from being inserted. If this Javascript function is defined, it will be triggered after a new page of Notes has been inserted into the DOM.

tumblrNotesInserted()

Tags
{block:HasTags} {/block:HasTags} {block:Tags} {/block:Tags} {Tag} {URLSafeTag} {TagURL} {TagURLChrono} Rendered inside {block:Posts} if post has tags.

Rendered for each of a post's tags. The name of this tag. A URL safe version of this tag. The tag page URL with other posts that share this tag. The tag page URL with other posts that share this tag in chronological order.

EXAMPLE

<html> <body> {block:Posts} <div class="post"> {block:Text}...{/block:Text} {block:Photo}...{/block:Photo} ... {block:HasTags} <ul class="tags"> {block:Tags} <li> <a href="{TagURL}">{Tag}</a> </li> {/block:Tags} </ul> {/block:HasTags} </div> {/block:Posts} </body> </html>

Group Blogs
{block:GroupMembers} {/block:GroupMembers} {block:GroupMember} {/block:GroupMember} {GroupMemberName} {GroupMemberTitle} {GroupMemberURL} {GroupMemberPortraitURL-16} {GroupMemberPortraitURL-24} {GroupMemberPortraitURL-30} {GroupMemberPortraitURL-40} {GroupMemberPortraitURL-48} {GroupMemberPortraitURL-64} {GroupMemberPortraitURL-96} {GroupMemberPortraitURL128} Rendered on additional public group blogs.

Rendered for each additional public group blog member.

The username of the member's blog. The title of the member's blog. The URL for the member's blog. Portrait photo URL for the member. 16-pixels by 16-pixels. Portrait photo URL for the member. 24-pixels by 24-pixels. Portrait photo URL for the member. 30-pixels by 30-pixels. Portrait photo URL for the member. 40-pixels by 40-pixels. Portrait photo URL for the member. 48-pixels by 48-pixels. Portrait photo URL for the member. 64-pixels by 64-pixels. Portrait photo URL for the member. 96-pixels by 96-pixels. Portrait photo URL for the member. 128-pixels by 128pixels.

Group Blog Posts


{PostAuthorName} The username of the author of a post to an additional group blog. The title of the author's blog for a post to an additional group blog. The blog URL for the author of a post to an additional group blog. The portrait photo URL for the author of a post to an additional group blog. 16-pixels by 16-pixels. The portrait photo URL for the author of a post to an additional group blog. 24-pixels by 24-pixels. The portrait photo URL for the author of a post to an additional group blog. 30-pixels by 30-pixels. The portrait photo URL for the author of a post to an additional group blog. 40-pixels by 40-pixels. The portrait photo URL for the author of a post to an additional group blog. 48-pixels by 48-pixels. The portrait photo URL for the author of a post to an additional group blog. 64-pixels by 64-pixels. The portrait photo URL for the author of a post to an additional group blog. 96-pixels by 96-pixels. The portrait photo URL for the author of a post to an additional group blog. 128-pixels by 128-pixels.

{PostAuthorTitle}

{PostAuthorURL}

{PostAuthorPortraitURL-16}

{PostAuthorPortraitURL-24}

{PostAuthorPortraitURL-30}

{PostAuthorPortraitURL-40}

{PostAuthorPortraitURL-48}

{PostAuthorPortraitURL-64}

{PostAuthorPortraitURL-96}

{PostAuthorPortraitURL-128}

Day Pages
Tumblr blogs can display posts from a given day using a URL like http://david.tumblr.com/day/2007/04/29/ By including the following markup, these pages can include pagination for the previous and next days with posts.
{block:DayPage} {/block:DayPage} {block:DayPagination} {/block:DayPagination} {block:PreviousDayPage} {/block:PreviousDayPage} {block:NextDayPage} {/block:NextDayPage} {PreviousDayPage} {NextDayPage}
EXAMPLE

Rendered on day pages.

Rendered if there is a "previous" or "next" day page.

Rendered if there is a "previous" day page to navigate to.

Rendered if there is a "next" day page to navigate to.

URL for the "previous" day page. URL for the "next" day page.

<html> <body> <h1>{Title}</h1> {block:DayPage} <h2>{Month} {DayOfMonth}, {Year}</h2> {/block:DayPage} <ol id="posts"> {block:Posts} ... {/block:Posts} </ol> <div id="footer"> {block:Pagination} {block:PreviousPage} <a href="{PreviousPage}">&#171; Previous</a> {/block:PreviousPage} {block:NextPage} <a href="{NextPage}">Next &#187;</a> {/block:NextPage} {/block:Pagination} {block:DayPagination} {block:PreviousDayPage} <a href="{PreviousDayPage}"> &#171; {ShortMonth} {DayOfMonth} </a> {/block:PreviousDayPage} {block:NextDayPage} <a href="{NextDayPage}"> {ShortMonth} {DayOfMonth} &#187; </a> {/block:NextDayPage} {/block:DayPagination} </div> </body> </html>

Tag Pages
{block:TagPage} {/block:TagPage} {Tag} {URLSafeTag} {TagURL} {TagURLChrono} Rendered on tag pages.

The name of this tag. A URL safe version of this tag. The tag page URL with other posts that share this tag. The tag page URL with other posts that share this tag in chronological order.

EXAMPLE

<html> <body> {block:TagPage} <h2>Posts tagged "{Tag}"</h2> {/block:TagPage} {block:Posts} ... {/block:Posts}

</body> </html>

Search
{SearchQuery} {URLSafeSearchQuery} The current search query. A URL-safe version of the current search query for use in links and Javascript. Rendered on search pages. The number of results returned for the current search query. Rendered if no search results were returned for the current search query.

{block:SearchPage} {SearchResultCount} {block:NoSearchResults}

EXAMPLE

<form action="/search" method="get"> <input type="text" name="q" value="{SearchQuery}"/> <input type="submit" value="Search"/> </form>

Following
{block:Following} {/block:Following} {block:Followed} {/block:Followed} {FollowedName} {FollowedTitle} {FollowedURL} {FollowedPortraitURL-16} Rendered if you're following other blogs.

Rendered for each blog you're following.

The username of the blog you're following. The title of the blog you're following. The URL for the blog you're following. Portrait photo URL for the blog you're following. 16-pixels by 16-pixels. Portrait photo URL for the blog you're following. 24-pixels by 24-pixels. Portrait photo URL for the blog you're following. 30-pixels by 30-pixels. Portrait photo URL for the blog you're following. 40-pixels by 40-pixels. Portrait photo URL for the blog you're following. 48-pixels by 48-pixels. Portrait photo URL for the blog you're following. 64-pixels by 64-pixels. Portrait photo URL for the blog you're following. 96-pixels by 96-pixels. Portrait photo URL for the blog you're following. 128-pixels by 128-pixels.

{FollowedPortraitURL-24}

{FollowedPortraitURL-30}

{FollowedPortraitURL-40}

{FollowedPortraitURL-48}

{FollowedPortraitURL-64}

{FollowedPortraitURL-96}

{FollowedPortraitURL-128}

EXAMPLE

{block:Following} Blogs I follow: <ul> {block:Followed} <li> <img src="{FollowedPortraitURL-48}"/> <a href="{FollowedURL}">{FollowedName}</a> </li> {/block:Followed} </ul> {/block:Following}

Likes
{block:Likes} {/block:Likes} {Likes} {Likes limit="5"} {Likes width="200"} Rendered if you are sharing your likes. Standard HTML output of your likes. Standard HTML output of your last 5 likes. Maximum: 10 Standard HTML output of your likes with Audio and Video players scaled to 200-pixels wide. (Scale images with CSS

max-width or similar.) {Likes summarize="100"} Standard HTML output of your likes with text summarize to 100-characters. Maximum: 250

EXAMPLE

<html> <head> <style type="text/css"> ul#likes { list-style-type: none; margin: 0 0 0 0; padding: 0 0 0 0; } li.like_post { /* Should match the width specified in the Likes tag */ width: 150px; padding: 0 40px 0 0; float: left; } li.like_post img { max-width: 100%; } li.like_post blockquote { margin: 0; padding: 0 0 0 10px; border-left: 1px solid #eee; } li.like_post ol, li.like_post ul { margin: 0 0 0 15px; padding: 0; } li.like_post .like_link a { font-weight: bold; } li.like_post .like_title { font-weight: bold; } li.like_post .post_info_bottom { margin: 10px 0 0 0; display: block !important; } </style> </head> <body> ... {block:Likes} <div id="likes_container"> <h2>Stuff I like</h2> {Likes limit="5" summarize="100" width="150"} <a href="http://www.tumblr.com/liked/by/{Name}"> See more stuff I like </a> </div> {/block:Likes} </body> </html>

Enabling Custom Colors


By including the special meta-color tags in your theme, users can easily tweak those colors using the "Customize" screen.
EXAMPLE

<html> <head> <!-- DEFAULT COLORS --> <meta name="color:Background" content="#eee"/> <meta name="color:Content Background" content="#fff"/> <meta name="color:Text" content="#000"/> <style type="text/css"> #content { background-color: {color:Content Background}; color: {color:Text}; } </style> </head> <body bgcolor="{color:Background}"> <div id="content"> ... </div> </body>

</html>

Enabling Custom Fonts


By including the special meta-font tags in your theme, users can easily change those fonts using the "Customize" screen.
EXAMPLE

<html> <head> <!-- DEFAULT FONTS --> <meta name="font:Title" content="Helvetica Neue"/> <meta name="font:Body" content="Arial, Helvetica, sans-serif"/> <style type="text/css"> h1 { font: 30px {font:Title}; } #content { font: 12px {font:Body}; } </style> </head> ... </html>

Enabling Booleans
By including the special meta-if tags in your theme, users can easily toggle options you define. This is useful for showing or hiding different widgets or design elements.
EXAMPLE

<html> <head> <!-- DEFAULTS --> <meta name="if:Show people I follow" content="1"/> <meta name="if:Reverse pagination" content="0"/> </head> <body> {block:IfNotReversePagination} <a href="...">Previous</a> <a href="...">Next</a> {/block:IfNotReversePagination} {block:IfReversePagination} <a href="...">Next</a> <a href="...">Previous</a> {/block:IfReversePagination} {block:IfShowPeopleIFollow} <div id="following">...</div> {/block:IfShowPeopleIFollow} </body> </html>

Enabling Custom Text


By including the special meta-text tags in your theme, users can easily configure text variables you define. This is useful for adjusting text or configuring widgets that require information from the user.
EXAMPLE

<html> <head> <!-- DEFAULT TEXT --> <meta name="text:Flickr Username" content=""/> </head> <body> {block:IfFlickrUsername} <div id="flickr_widget"> <script type="text/javascript" src="http://flickr.com/widget?user={text:Flickr Username}"> </script> </div> {/block:IfFlickrUsername} </body> </html>

Enabling Custom Images


By including the special meta-image tags in your theme, users can easily use custom images without editing your theme. Image variables (eg. {image:Logo}) will return a 1-pixel transparent square if no image is set.
EXAMPLE

<html>

<head> <!-- DEFAULT IMAGE --> <meta name="image:Background" content="http://static.tumblr.com/..."/> <meta name="image:Header" content=""/> <style type="text/css"> body { background: #2D567C url('{image:Background}'); } </style> </head> <body> {block:IfHeaderImage}<img src="{image:Header}"/>{/block:IfHeaderImage} {block:IfNotHeaderImage}<h1>{Title}</h1>{/block:IfNotHeaderImage} </body> </html>

Enabling Custom CSS


By including the {CustomCSS} tag at the bottom of your theme's CSS style block, users you share your theme with will be able to tweak the appearance of your theme without editing its markup.
EXAMPLE

<html> <head> <style type="text/css"> #content { background-color: #fff; color: #000; } {CustomCSS} </style> </head> <body> <div id="content"> ... </div> </body> </html>

Twitter
If you've enabled Twitter integration in your Tumblr preferences, you can include the /tweets.js Javascript file on your primary blog to display your recent tweets. This file runs the callback function recent_tweets(), sending the Twitter API JSON data as its only parameter.
{block:Twitter} {/block:Twitter} {TwitterUsername}
EXAMPLE

Rendered if you have Twitter integration enabled. Your Twitter username.

{block:Twitter} <div id="twitter" style="display:none;"> <h3><a href="http://twitter.com/{TwitterUsername}">Latest Tweets</a></h3> <div id="tweets"></div> </div> <script type="text/javascript"> function recent_tweets(data) { for (i=0; i<data.length; i++) { document.getElementById("tweets").innerHTML = document.getElementById("tweets").innerHTML + '<a href="http://twitter.com/{TwitterUsername}/status/' + data[i].id + '"><div class="content">' + data[i].text + '</div></a>'; } document.getElementById("twitter").style.display = 'block'; } </script> {/block:Twitter} <!-- Put this at the bottom of the page --> {block:Twitter} <script type="text/javascript" src="/tweets.js"></script> {/block:Twitter}

iPhone Themes
Tumblr blogs automatically use optimized layouts when browsing on mobile devices. The iPhone layout can be overridden by adding a Custom Layout Page (via Customize) to your blog with the URL /iphone-theme.

Variable Transformations

By prefixing variables with special transformation keywords, Tumblr will output variables in specialized formats useful when passing data to Javascript, etc. Tumblr currently supports four transformations:
Plaintext Prefix any theme variable with Plaintext to output the string with HTML-tags stripped and appropriate characters converted to HTML-entities (so theyre safe to include in HTML attributes, etc.). Prefix any theme variable with JS to output a Javascript string (wrapped in quotes). Prefix any theme variable with JSPlaintext to output a Javascript string (wrapped in quotes) with HTML-tags stripped and appropriate characters converted to HTMLentities. Prefix any theme variable with URLEncoded to output a URL encoded string.

Javascript

Javascript Plaintext

URLEncoded

EXAMPLE

<a href="{URL}" title="{PlaintextName}">{Name}</a> <script type="text/javascript"> var description = {JSDescription}; var description_text = {JSPlaintextDescription}; </script> <a href="http://digg.com/submit?url={URLEncodedPermalink}">Digg this</a>

English

Deutsch

Can't find what you're looking for? Email support@tumblr.com

Tumblr, Inc.

Help

About

Themes

Meetups

What's New

API

Jobs

Content Policy

Terms of Service

Privacy Policy

S-ar putea să vă placă și