Hiding stuff properly in your blog
Posted by adrengski on Thursday, June 7th, 2012Tagged as: tips theme docs
Ever wanted to hide those Disqus Comments from your Ask page? Or just make something appear only on your blog’s front page or maybe just in your permalink/post pages? Through out the time I’ve spend fiddling with my themes here in Tumblr, I’ve found some useful nuggets to remember whenever you want to properly hide stuff/parts of your blog depending on where the visitor is. All you’ll have to do is wrap the parts inside some few codes.
{block:IndexPage}{/block:IndexPage}
Anything you wrap inside these codes will appear on your blog’s index/front page and “/tagged” pages. This would be useful for stuff that you don’t want to appear in your posts’ page.
{block:PermalinkPage}{/block:PermalinkPage}
Stuff that are wrapped inside these codes will only appear in your post’s pages, the Ask page and the Submission page(if it’s enabled). Despite the note on the Theme Docs that this is “Useful for embedding comment widgets”, you’d want to refrain from using this unless you really want to make Comment widgets to appear in your Ask Page, too.
{block:PermalinkPagination}{/block:PermalinkPagination}
This would be the way to go with regards to Comment widgets. I’m not entirely sure why this isn’t in the Theme Docs, but anything you wrap in these codes will only appear in your permalink/post pages. They will be properly hidden from the Ask page, Submission page, and Custom Pages. So in short, this will hide all those Disqus Comments from your Ask page.
{block:TagPage} {/block:TagPage}
Hides stuff from everywhere except the tag pages(yoururl.tumblr.com/tagged/yourtags). Would be useful if you want to put a page indicator somewhere and you want to put in the tags being viewed.
{block:AskEnabled}{/block:AskEnabled}
This will hide anything as long as your Ask feature is disabled. Useful for hiding ask links when it’s disabled.
{block:SubmissionsEnabled}{/block:SubmissionsEnabled}
Just like the previous one, this hides anything as long as the Submit Feature is disabled. I’m not entirely sure where on earth would you use this but I guess hiding Submit links would be one of them.
{block:Date}{/block:Date}
These can hide stuff from your Ask page, Custom pages, and the Submission Page. To put it simply, this would be useful if you want to make a part appear only in the Index(Front) page and Permalink(post) Pages. Useful for stuff like, obviously, Dates that you wouldn’t want to appear on the Ask page or in your Custom pages, since they don’t have dates anyway. Note though, this will only work if this is inside the {block:Posts}{/block:Posts} codes. So this isn’t really useful for Comment widgets. Just dates. Remember that.
{block:NoteCount}{/block:NoteCount}
You can use this to hide a part of your post if it doesn’t have a note(Yeah, shame on that. Just like most of the posts in this blog; no notes…sob). Not much real use really, unless it’s for hiding Notes, obviously.
That’s it! Hope that helps and happy hiding stuff.