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.


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 Jun 26 '14 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 Jun 26 '14 at 9:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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