0

What is the correct syntax for setting the selected year drop down upon a search?

{exp:low_events:archive 
                events_field="events_date_time" 
                show_passed="no" 
                show_future_entries="yes"
                unit='year'
            }
<option {if low_search_low_events:date == date_url} selected="selected"{/if} value="{year}">{year}</option>
{/exp:low_events:archive}

This works when unit is set to month, but not year.

1 Answer 1

1

The value of the option is the {year} val, so use year instead of date_url in your conditional.

2
  • low_search_low_events:date is outputting dates in the format yyyy-mm so how does yyyy-mm == yyyy ?
    – BillyMedia
    Commented Jun 26, 2014 at 8:52
  • Then add more info to your original question. What's the name of the select element that is part of the options you're generating? Better still, what does the full Form tag look like?
    – Low
    Commented Jun 26, 2014 at 9:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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