Skip to content

Instantly share code, notes, and snippets.

@mdcpepper
Created May 20, 2014 13:48
Show Gist options
  • Save mdcpepper/3f4493b66421beee851a to your computer and use it in GitHub Desktop.
Save mdcpepper/3f4493b66421beee851a to your computer and use it in GitHub Desktop.
{% set searchTerm = craft.request.getParam('search') %}
{% set entries = craft.entries.hideFromSearchResults([0]).search(searchTerm).limit(25) %}
{% if searchTerm and entries|length %}
{% paginate entries as page %}
{% for entry in page %}
{% include [ entry.section.handle~"/_excerpt-search",
"pages/_excerpt-search",
"_errors/template-missing-search" ] %}
{% endfor %}
{{ macro.pagination(paginate, ['search']) }}
{% endpaginate %}
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment