2

I'm trying to do some stuff on my Tumblr layout, and I want some links to remain accurate regardless of whether the blog's URL later change. Either this is not possible from the documented variables or, if it is possible, is done via another mean.

Is there a mean to achieve that?

1

You can use the name variable as long as it references the root "/"

<h1><a href="/">{Name}</a></h1>
  • {Name} is document as several things, and I failed to see this (completely) use in one of the examples for the {block:likes}: <a href="http://www.tumblr.com/liked/by/{Name}">. Looks like I got what I wanted. I just hope it works elsewhere. – Circeus Apr 2 '12 at 3:29
1

The {Host} variable returns the host name of the tumblr blog. For example, if the URL is http://foo.tumblr.com, {Host} will return foo.tumblr.com. Similarly, using {Host} for custom domains, i.e. http://www.my-tumblr-blog.com will return www.my-tumblr-blog.com.

You can use the following code for generating links:

<h1><a href="http://{Host}">{Name}</a></h1>

or better:

<h1><a href="//{Host}">{Name}</a></h1>
1

This works great for Tumblr themes, secondary blog was showing primary username but with this code it shows username of any blog (primary and/or secondary):

{block:NotReblog}<p>By <a href="{BlogURL}">{name}</a></p>{/block:NotReblog}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.