{# TODO: find a way to embed this logic into the site-search component #}
{% if in_url('sort') and in_url('organization') %}
{% set action = url_for('datasets.list') %}
{% set placeholder = _('Search in datasets') %}
{% elif territory %}
{% set action = url_for('datasets.list') %}
{% set placeholder = _('Search in this ') + territory.level_i18n_name|lower %}
{% else %}
{% set action = url_for('search.index') %}
{% set placeholder = _('Search') %}
{% endif %}
{{ site_search(action=action, placeholder=placeholder, territory=territory) }}
{% cache cache_duration, 'subnav-small-featured-topics', g.lang_code|default(config.DEFAULT_LANGUAGE)|string %}
{# Topic chooser #}
{% endcache %}
{# Publish call to action #}