diff --git a/themes/bootstrap3/templates/search/home.phtml b/themes/bootstrap3/templates/search/home.phtml index acde395e2420bc39a7b248ef8d96666f4526df9e..62a0e0a6b572f8da567a37ed760ff6fc68ece255 100644 --- a/themes/bootstrap3/templates/search/home.phtml +++ b/themes/bootstrap3/templates/search/home.phtml @@ -33,48 +33,50 @@ </div> </div> -<? $facetList = is_object($this->results) ? $this->results->getFacetList() : array(); if (isset($facetList) && is_array($facetList)): ?> -<div class="row"> - <? foreach ($facetList as $field => $details): ?> - <? $sortedList = $this->sortFacetList($this->results, $field, $details['list'], $basicSearch); ?> - <div class="<?=$field=='callnumber-first' ? 'col-sm-6' : 'col-sm-3' ?>"> - <p class="lead"><?=$this->transEsc('home_browse') . ' ' . $this->transEsc($details['label'])?></p> - <div class="row"> - <ul class="list-unstyled <?=$field == "callnumber-first" ? 'col-sm-6' : 'col-sm-12' ?>"> - <? /* Special case: two columns for LC call numbers... */ ?> - <? if ($field == "callnumber-first"): ?> - <? $i = 0; foreach ($sortedList as $url => $value): ?> - <? if (!empty($value)): ?> - <li><a href="<?=$url?>"><?=$this->escapeHtml($value)?></a></li> - <? else: $i--; ?> - <? endif; ?> - <? if (++$i == 10): ?> - </ul><ul class="list-unstyled col-sm-6"> - <? endif; ?> - <? endforeach; ?> - <? /* Special case: collections */ ?> - <? elseif ($field == 'hierarchy_top_title'): ?> - <? $i = 0; foreach ($sortedList as $url => $value): ?> - <? if (++$i > 10): ?> - <li><a href="<?=$this->url('collections-home')?>"><strong><?=$this->transEsc("More options")?>...</strong></a></li> - <? break; ?> - <? else: ?> - <li><a href="<?=$this->url('collections-bytitle')?>?title=<?=urlencode($value)?>"><?=$this->escapeHtml($value)?></a></li> - <? endif; ?> - <? endforeach; ?> - <? else: ?> - <? $i = 0; foreach ($sortedList as $url => $value): ?> - <? if (++$i > 10): ?> - <li><a href="<?=$this->url($advSearch)?>"><strong><?=$this->transEsc("More options")?>...</strong></a></li> - <? break; ?> - <? elseif (!empty($value)): ?> - <li><a href="<?=$url?>"><?=$this->escapeHtml($value)?></a></li> - <? else: $i--; ?> - <? endif; ?> - <? endforeach; ?> - <? endif; ?> - </ul> +<? $facetList = is_object($this->results) ? $this->results->getFacetList() : array(); ?> +<? if (isset($facetList) && is_array($facetList)): ?> + <div class="row"> + <? foreach ($facetList as $field => $details): ?> + <? $sortedList = $this->sortFacetList($this->results, $field, $details['list'], $basicSearch); ?> + <div class="<?=$field=='callnumber-first' ? 'col-sm-6' : 'col-sm-3' ?>"> + <p class="lead"><?=$this->transEsc('home_browse') . ' ' . $this->transEsc($details['label'])?></p> + <div class="row"> + <ul class="list-unstyled <?=$field == "callnumber-first" ? 'col-sm-6' : 'col-sm-12' ?>"> + <? /* Special case: two columns for LC call numbers... */ ?> + <? if ($field == "callnumber-first"): ?> + <? $i = 0; foreach ($sortedList as $url => $value): ?> + <? if (!empty($value)): ?> + <li><a href="<?=$url?>"><?=$this->escapeHtml($value)?></a></li> + <? else: $i--; ?> + <? endif; ?> + <? if (++$i == 10): ?> + </ul><ul class="list-unstyled col-sm-6"> + <? endif; ?> + <? endforeach; ?> + <? /* Special case: collections */ ?> + <? elseif ($field == 'hierarchy_top_title'): ?> + <? $i = 0; foreach ($sortedList as $url => $value): ?> + <? if (++$i > 10): ?> + <li><a href="<?=$this->url('collections-home')?>"><strong><?=$this->transEsc("More options")?>...</strong></a></li> + <? break; ?> + <? else: ?> + <li><a href="<?=$this->url('collections-bytitle')?>?title=<?=urlencode($value)?>"><?=$this->escapeHtml($value)?></a></li> + <? endif; ?> + <? endforeach; ?> + <? else: ?> + <? $i = 0; foreach ($sortedList as $url => $value): ?> + <? if (++$i > 10): ?> + <li><a href="<?=$this->url($advSearch)?>"><strong><?=$this->transEsc("More options")?>...</strong></a></li> + <? break; ?> + <? elseif (!empty($value)): ?> + <li><a href="<?=$url?>"><?=$this->escapeHtml($value)?></a></li> + <? else: $i--; ?> + <? endif; ?> + <? endforeach; ?> + <? endif; ?> + </ul> + </div> </div> - </div> - <? endforeach; ?> + <? endforeach; ?> + </div> <? endif; ?> \ No newline at end of file