#macro(lensNoQ)?#if($list.size($response.responseHeader.params.getAll("fq")) > 0)fqs($response.responseHeader.params.getAll("fq"))#end#sort($request.params.getParams('sort'))#end
## lens modified for example/files - to use fq from responseHeader rather than request, and #debug removed too as it is built into browse params now, also added type to lens
#macro(lens)#lensNoQ#q&type=#current_type#if("#current_locale"!="")&locale=#current_locale#end#end
# TODO: make this parameterized fully, no context sensitivity
#macro(field $f)
#if($response.response.highlighting.get($docId).get($f).get(0))
#set($pad = "")
#foreach($v in $response.response.highlighting.get($docId).get($f))
$pad$v## #TODO: $esc.html() or maybe make that optional?
#set($pad = " ... ")
#end
#else
#foreach($v in $doc.getFieldValues($f))$esc.html($v)
#end
#end
#end
#macro(link_to_previous_page)
#if($page.current_page_number > 1)
#set($prev_start = $page.start - $page.results_per_page)
$resource.previous
#end
#end
#macro(link_to_next_page)
#if($page.current_page_number < $page.page_count)
#set($next_start = $page.start + $page.results_per_page)
$resource.next
#end
#end
#macro(link_to_page $page_number $text)
#if($page_number == $page.current_page_number)
$text
#else
#if($page_number <= $page.page_count)
#set($page_start = $page_number * $page.results_per_page - $page.results_per_page)
$text
#end
#end
#end
## Macros defined custom for the "files" example
#macro(url_for_type $type)#url_for_home#lensNoQ#q&type=$type#if("#current_locale"!="")&locale=#current_locale#end#end
#macro(current_type)#if($response.responseHeader.params.type)${response.responseHeader.params.type}#{else}all#end#end
#macro(url_for_locale $locale)#url_for_home#lensNoQ#q&type=#current_type#if($locale!="")&locale=$locale#end#end
#macro(current_locale)$!{response.responseHeader.params.locale}#end