{{! NOTE: Take careful care with the namespacing in here, it's a bit of a mess. }}
<input type="text" placeholder="Places search" name="q" value="{{query}}">
<span class="deleteicon ss-icon">delete</span>
<ul class="results-list">
    {{#types}}
        {{#if types}}
            {{! If this category has any sub-categories, place a link to them }}
            {{#if ../../category_name}}
                <a href="#places/categories/{{ ../../../category_name }}/{{ type }}"><li><h3>{{ type_name }}</h3></li></a>
            {{else}}
                <a href="#places/categories/{{ type }}"><li><h3>{{ type_name }}</h3></li></a>
            {{/if}}
        {{else}}
            <a href="#places/search?type=/{{ ../../category_name }}/{{ type }}"><li><h3>{{ type_name }}</h3></li></a>
        {{/if}}
    {{/types}}
</ul>

{{! NOTE: Take careful care with the namespacing in here, it's a bit of a mess. }}
<input type="text" placeholder="Places search" name="q" value="{{query}}">
<span class="deleteicon ss-icon">delete</span>
<ul class="results-list">
    {{#types}}
        {{#if types}}
            {{! If this category has any sub-categories, place a link to them }}
            {{#if ../../category_name}}
            <a data-category="{{ ../../../category_name }}/{{ type }}" href="#places/categories/{{ ../../../category_name }}/{{ type }}"><li><h3>{{ type_name }}</h3></li></a>
            {{else}}
                <a data-category="{{ type }}" href="#places/categories/{{ type }}"><li><h3>{{ type_name }}</h3></li></a>
            {{/if}}
        {{else}}
            <a href="#places/search?type=/{{ ../../category_name }}/{{ type }}"><li><h3>{{ type_name }}</h3></li></a>
        {{/if}}
    {{/types}}
</ul>

Set a data attribute on each category to help navigating.
Set a data attribute on each category to help navigating.
