63 lines
1.5 KiB
PHTML
63 lines
1.5 KiB
PHTML
<?php
|
|
$fulltextSearch = $this->params()->fromQuery('fulltext_search');
|
|
$hasResults = false;
|
|
?>
|
|
|
|
<?php
|
|
$site->pages();
|
|
// set header image
|
|
$img_src = $this->getHelperPluginManager()->get('archiveSiteMeta')->getSiteImage($site);
|
|
if ($img_src) {
|
|
?>
|
|
<style>
|
|
#archive_header_img {
|
|
background:url("<?= $img_src ?>") no-repeat;
|
|
width:100%;
|
|
height:100px;
|
|
}
|
|
</style>
|
|
<?php } else { ?>
|
|
<style>
|
|
#archive_header_img {
|
|
display: none;
|
|
}
|
|
</style>
|
|
<?php } ?>
|
|
|
|
<h2><?php echo sprintf($this->translate('Search results for “%s”'), $fulltextSearch); ?></h2>
|
|
|
|
<div class="results">
|
|
<?php
|
|
if ($responseSitePages && $responseSitePages->getTotalResults()):
|
|
$hasResults = true;
|
|
?>
|
|
<?php
|
|
$sitePages = array();
|
|
foreach ($responseSitePages->getContent() as $sitePage) {
|
|
array_push($sitePages, $sitePage);
|
|
}
|
|
echo $this->partial('common/cross-site-search/site-page-results', [
|
|
'sitePages' => $sitePages,
|
|
]);
|
|
?>
|
|
<?php endif; ?>
|
|
<?php
|
|
if ($responseItems && $responseItems->getTotalResults()):
|
|
$hasResults = true;
|
|
?>
|
|
<?php
|
|
$items = array();
|
|
foreach ($responseItems->getContent() as $item) {
|
|
array_push($items, $item);
|
|
}
|
|
echo $this->partial('common/cross-site-search/item-results', [
|
|
'items' => $items,
|
|
]);
|
|
?>
|
|
<?php endif; ?>
|
|
</div>
|
|
|
|
<?php if (!$hasResults): ?>
|
|
<p><?php echo $this->translate('No result found'); ?>
|
|
<?php endif; ?>
|