Skip to content

Instantly share code, notes, and snippets.

@cedricdekimpe
Created October 24, 2013 09:10
Show Gist options
  • Save cedricdekimpe/7133808 to your computer and use it in GitHub Desktop.
Save cedricdekimpe/7133808 to your computer and use it in GitHub Desktop.
LocomotiveCMS search : liquid template
{% extends 'parent' %}
<h1>{{ page.title }}</h1>
{% if search_results.size == 0 %}
<p><strong>There is no result</strong></p>
{% endif %}
{% for result in search_results %}
{% case locale %}
{% when "fr" %}
{% capture url %}/index/{{result._permalink}}{% endcapture %}
{% else %}
{% capture url %}/index/{{locale}}/{{result._permalink}}{% endcapture %}
{% endcase %}
<h2><a href={{url}}>{{ result.title }}</a></h2>
<p>{{ result.summary }}</p>
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment