2021-05-08 11:44:47 +02:00
|
|
|
<?php
|
|
|
|
$fulltextSearch = $this->params()->fromQuery('fulltext_search');
|
|
|
|
$hasResults = false;
|
|
|
|
?>
|
|
|
|
|
|
|
|
<h2><?php echo sprintf($this->translate('Search results for “%s”'), $fulltextSearch); ?></h2>
|
|
|
|
|
2021-05-08 18:27:48 +02:00
|
|
|
<div class="results">
|
2021-05-08 11:44:47 +02:00
|
|
|
<?php
|
|
|
|
if ($responseSitePages && $responseSitePages->getTotalResults()):
|
|
|
|
$hasResults = true;
|
|
|
|
?>
|
2021-05-08 18:27:48 +02:00
|
|
|
<?php
|
|
|
|
$sitePages = array();
|
|
|
|
foreach ($responseSitePages->getContent() as $sitePage) {
|
|
|
|
array_push($sitePages, $sitePage);
|
|
|
|
}
|
|
|
|
echo $this->partial('common/cross-site-search/site-page-results', [
|
|
|
|
'sitePages' => $sitePages,
|
|
|
|
]);
|
|
|
|
?>
|
2021-05-08 11:44:47 +02:00
|
|
|
<?php endif; ?>
|
|
|
|
<?php
|
|
|
|
if ($responseItems && $responseItems->getTotalResults()):
|
|
|
|
$hasResults = true;
|
|
|
|
?>
|
2021-05-08 18:27:48 +02:00
|
|
|
<?php
|
|
|
|
$items = array();
|
|
|
|
foreach ($responseItems->getContent() as $item) {
|
|
|
|
array_push($items, $item);
|
|
|
|
}
|
|
|
|
echo $this->partial('common/cross-site-search/item-results', [
|
|
|
|
'items' => $items,
|
|
|
|
]);
|
|
|
|
?>
|
2021-05-08 11:44:47 +02:00
|
|
|
<?php endif; ?>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<?php if (!$hasResults): ?>
|
|
|
|
<p><?php echo $this->translate('No result found'); ?>
|
|
|
|
<?php endif; ?>
|