{% load search_utils %}

<li class="autocomplete-header">
  <span class="autocomplete-item">{{ section.verbose_name }}</span>
</li>

{% for entry in section.entries %}
  {% if forloop.counter < 5 %}
    <li class="autocomplete-value">
      {% if entry.link %}
        <a class="autocomplete-item" href="{{ entry.link }}">
          {{ entry.verbose_name | highlight:q }}
        </a>
      {% else %}
        <span class="autocomplete-item">
          {{ entry.verbose_name | highlight:q }}
        </span>
      {% endif %}
    </li>
  {% elif forloop.counter == 5 %}
    <li class="autocomplete-more">
      <span class="autocomplete-item">...</span>
    </li>
  {% endif %}
{% endfor %}
