'ElseIf' equivalent for output modifiers?

Hi there,

So I’ve been searchign the community but can’t find the solution!

I have a bunch of resoruces which are events. They are called like this:

[[pdoResources? &parents=`[[*id]]` &includeTVs=`availability` &tpl=`myTpl` ]]

In the resource, I can choose the availability of this event with a TV Radio button.
In myTpl, I want to change the content shown based on the value of the Radio button.

I can get it to work with two options using ‘else’, but I have three options - 1: limited, 2:sold out and the default if nothing is chosen.

This is my TPL so far which only works if ‘limited’ is chosen, but I need an ‘ElseIf’ for when a user chooses ‘sold out’. (I know I can’t use elseif with output modifiers)

<div class="box">
    [[+tv.availability:is=`limited`:then=`
         //show this
    </a>
`:else=`
    //show this
    `]]
</div>

I tried nesting it like this - but it doesn’t work:

<div class="box">
    [[+tv.availability:is=`limited`:then=`
         //show this
    </a>
`:else=`
[[+tv.availability:is=`sold-out`:then=`
         //show this
    </a>
    //show this
    ``:else=`
   //show this
`]]
</div>

Any hints on where I’m going wrong?
I suspect I need a snippet, but not sure how to construct it.

Thanks!
Andy

Apologies if I’m missing something but can you not just use a TV set to Listbox (single select) and then multiple input option values?

Hi.

Right - first off - I haven’t had enough coffee today. That’s my excuse an I’m sticking to it!!!

So I was overthiniing this - all I needed to do was put the text i wanted to use in the value of the radio buttons - so now this is my tpl:

<div class="box">
    	[[+tv.availability:notempty=`
         	//show this and [[+tv.availability]]
	`:default=`
    		//show this if neither are selected
	`]]
</div>

Works a treat. Right, let’s make that coffee…

2 Likes