Can you display tagged posts on a static page?

1,462 views
Skip to first unread message

kedow...@gmail.com

unread,
Aug 1, 2012, 3:23:44 PM8/1/12
to tumblr...@googlegroups.com
I'm having trouble figuring out how to display a specific tag on a static page. I know how to create a redirect link to a tag page, but what I want to do is have some content on the page in addition to all the posts with a specific tag. Is it possible?

I know HTML and CSS, but am new to tumblr.

Here's a link to the site: http://paintpushers.tumblr.com/ . My original plan was to set the tumblr up as a group blog and allow individual members to edit their static pages themselves. Then they could tag posts with their names to get them to show up on their page.

Sean Zhu

unread,
Aug 2, 2012, 6:09:13 AM8/2/12
to tumblr...@googlegroups.com, kedow...@gmail.com
I believe this is not possible as is.

However, with just a bit of JavaScript, you can get a custom "intro" to show up on each tag page, but the intro would be hard to customize because it would need to be written into the theme code.

If you really really want the intro content to come from a static page, you're probably going to have to work with XMLHttpRequest or iframes. Actually, I think there's a fairly elegant way that makes use of an iframe and iframeElement.contentWindow.document.body.innerHTML.

Are you willing to have the intro text show up only when people are using JavaScript?

pouretrebelle

unread,
Aug 3, 2012, 5:45:01 AM8/3/12
to tumblr...@googlegroups.com, kedow...@gmail.com
Building on what Sean said I found a pretty elegant way of doing this with ajax on a tagged page on this blog.
So say you're at '/tagged/bob', with a bit of jquery in a {block:TagPage} you can load the contents of a custom page '/bob'. Instead of putting tagged posts on a static page you can just put a static page on a tagged page. Put this snippet of code somewhere on your theme (actually it would be super nice if you put it inside where the {block:TagPage} already is as the first post of a tag page) and make a custom-layout page with the same name as one of your artists; it should work out of box as your theme already has jquery loaded.

{block:TagPage} 
<script type="text/javascript">
$(document).ready(function() {
    $('#taginfo').load('/{URLSafeTag}');
});
</script>
<div id="taginfo"></div>
{/block:TagPage}

Kevin Byrd

unread,
Jan 22, 2014, 2:33:47 AM1/22/14
to tumblr...@googlegroups.com, kedow...@gmail.com
This is really brilliant! I've been searching for a way to do this for months. Do you mind if I include a variation of it in my custom theme? I added _html after  {URLSafeTag}, since I was already using a page sharing the tag's name to redirect to the tagged page (as a lot of folks do.) I figure adding something to the url is the best solution, and it works.

 It's a Redux edit that I make available for download. I think this is a very simple way to add TONS of power to a Tumblr blog - especially for users that use tags methodically. I'd be happy to credit you. I don't know if it's ok to post links here, the theme is called "Redux Redux" and can be found on Tumblr.
Reply all
Reply to author
Forward
0 new messages