Skip to content

Instantly share code, notes, and snippets.

@dreadfullyposh
Created May 16, 2014 21:19
Show Gist options
  • Save dreadfullyposh/44ce584f21bcbc2e8875 to your computer and use it in GitHub Desktop.
Save dreadfullyposh/44ce584f21bcbc2e8875 to your computer and use it in GitHub Desktop.
json template
{exp:http_header content_type="application/javascript"}
{
{exp:low_search:results
{if get_post:keywords}keywords="{get_post:keywords}"{/if}
{if search:sites}child:index_site="{search:sites}"{/if}
disable="member_data|categories|category_fields|pagination"
collection="index"
backspace="1"
log_search="yes"
}
{if count == 1}
"keywords" : "{low_search_keywords}",
"site" : "{get_post:site}",
"total_results" : "{absolute_results}",
"results" : [
{/if}
{
"id" : "{count}",
"title" : "{title}",
"excerpt" : "{exp:eehive_hacksaw words="50" append="..."}{index_excerpt}{/exp:eehive_hacksaw}",
"site" : "{exp:playa:children field="index_site"}{url_title}{/exp:playa:children}",
"url" : "{index_url}",
"score" : "{low_search_score}"
}
{if absolute_results == count}
]
{if:else}
,
{/if}
{/exp:low_search:results}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment