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

<option {if low_search_low_events:date == date_url} selected="selected"{/if} value="{year}">{year}</option>

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

1 Answer 1


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

  • 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.