Module, Plugin

Archived
Forum
(read-only)

Reefine

ExpressionEngine 2, ExpressionEngine 3, ExpressionEngine 4, ExpressionEngine 5, ExpressionEngine 6

Back to this add-on's main page
View Other Add-ons From Patrick Woodcock

     

Can you do conditional filters?

Support Request

jmg
jmg

I have a channel which includes two different fields for cities and states. Can I select the states with one filter and limit the cities with another?

Ralph
# 1
Ralph

If I’m reading it right, you would like to hide the cities until the user selects a country? If you’re using method=“url” (the default) Then you could put a conditional in like this: (assuming the country is in segment 2 and the cities filter group is called cities_filter_group)

{if segment_2 != "" && segment_2 != "any"
   {cities_filter_group} 
... {/cities_filter_group} 
{
/if}