Search code examples
tumblrmeta-tags

Create a drop-down menu with Tumblr theme meta-if tags?


Is it possible to create a drop-down menu in the Tumblr theme appearance options using meta-if tags/booleans, like you can for the meta-font tags? For example, in the theme I'm working on, I have different numbers of columns meta-if options. My HTML for that looks like this:

<meta name="if:1 Column" content="0"/>
<meta name="if:2 Columns" content="0"/>
<meta name="if:3 Columns" content="1"/>

and the CSS like this:

{block:If1Column} 1 Column css here {/block:If1Column}
{block:If2Columns} 2 Columns css here {/block:If2Columns}
{block:If3Columns} 3 Columns css here {/block:If3Columns}

In the appearance options, "1 Column," "2 Columns," and "3 Columns" show up as options with a checkbox next to them. But the problem is, if you check more than one of them, or none of them, the theme gets all messed up. So I was wondering if there's any way I could replace the checkboxes with a drop-down menu, like with fonts, or somehow make it so you can only choose one of them?


Solution

  • This is now (kinda) possible.

    The meta tags look like this:

    <meta name="select:Columns" title="2" content="two-col" />
    <meta name="select:Columns" title="3" content="three-col" />
    

    And then you can use {select:Columns} wherever you want and it will be replaced with the content of the selected option.