If/Else Block

820 views
Skip to first unread message

Tom Kenkel

unread,
Aug 14, 2012, 4:48:56 PM8/14/12
to tumblr...@googlegroups.com
I built my first Tumblr theme last week and love the simplicity of including items like custom text. I am wondering if Tumblr has an If/Else-type block, such that if a boolean option is set to "0", contentX appears, but when set to "1", contentY appears?

{block:IfBooleanText}
<header><h1>{text:Boolean Text}</h1></header>
{/block:IfBooleanText}

{block:ElseBooleanText}
<header><h1>Howdy</h1></header>
{/block:ElseBooleanText}

…something like that.

Thanks!

Vladimir Starkov

unread,
Aug 15, 2012, 6:43:19 AM8/15/12
to tumblr...@googlegroups.com
See Appearance options section ‘Enabling Booleans’ subsection:

If you have `Boolean_Var` variable:
    
    <meta name="if:Boolean_Var" content="0" />

These statements would be your if/else block:

    {block:IfBoolean_Var} true {/block:IfBoolean_Var}
    {block:IfNotBoolean_Var} false {/block:IfNotBoolean_Var}

Tom Kenkel

unread,
Aug 15, 2012, 2:33:41 PM8/15/12
to tumblr...@googlegroups.com
Perfect, thanks.
Reply all
Reply to author
Forward
0 new messages