makes a search from the Collections site render a collections list
This commit is contained in:
parent
406a92b3f7
commit
551ba6b214
|
@ -1,6 +1,5 @@
|
|||
<?php
|
||||
$archiveSiteHelper = $this->getHelperPluginManager()->get('archiveSiteMeta');
|
||||
$collections = $archiveSiteHelper->getCollections();
|
||||
?>
|
||||
|
||||
<div class="list-of-sites">
|
||||
|
@ -17,11 +16,9 @@ $collections = $archiveSiteHelper->getCollections();
|
|||
</thead>
|
||||
<tbody>
|
||||
|
||||
|
||||
<?php
|
||||
foreach($sites as $site):
|
||||
$site_meta_values = $archiveSiteHelper->getSiteMetaValues($site);
|
||||
//echo $this->partial('common/index/site-list-item', [
|
||||
echo $this->partial('common/site-list-entry', [
|
||||
'site' => $site,
|
||||
'showSummary' => $summaries,
|
||||
|
@ -36,7 +33,8 @@ $collections = $archiveSiteHelper->getCollections();
|
|||
|
||||
</div>
|
||||
<?php
|
||||
if ($pagination):
|
||||
if (1 == 0):
|
||||
//if ($pagination):
|
||||
echo $this->pagination();
|
||||
endif;
|
||||
?>
|
||||
|
|
|
@ -2,7 +2,10 @@
|
|||
$fulltextSearch = $this->params()->fromQuery('fulltext_search');
|
||||
$hasResults = false;
|
||||
?>
|
||||
|
||||
<?php
|
||||
//$archiveSiteHelper = $this->getHelperPluginManager()->get('archiveSiteMeta');
|
||||
//$collections = $archiveSiteHelper->getCollections();
|
||||
?>
|
||||
|
||||
<!-- arc-hive insert begins -->
|
||||
<?php
|
||||
|
@ -22,11 +25,14 @@ if (!$img_src) {
|
|||
|
||||
<script>
|
||||
<?php
|
||||
$_html = '<a href="'.$this->site->url().'">'.$this->site->title().'</a>';
|
||||
/*
|
||||
if ($this->site->title() != "Collections") {
|
||||
$_html = '<a href="'.$this->site->url().'">'.$this->site->title().'</a>';
|
||||
} else {
|
||||
$_html = $this->site->title();
|
||||
}
|
||||
*/
|
||||
?>
|
||||
$("#archive_page_title").html('<?php echo $_html ?>');
|
||||
</script>
|
||||
|
@ -36,6 +42,34 @@ $("#archive_page_title").html('<?php echo $_html ?>');
|
|||
|
||||
|
||||
<div class="results">
|
||||
<?php
|
||||
if ($this->site->title() == "Collections") {
|
||||
/* convert all the results into sites and display the list of sites */
|
||||
$result = array();
|
||||
if ($responseSitePages && $responseSitePages->getTotalResults()) {
|
||||
$hasResults = true;
|
||||
foreach ($responseSitePages->getContent() as $sitePage) {
|
||||
$site = $sitePage->site();
|
||||
array_push($result, $site);
|
||||
}
|
||||
}
|
||||
if ($responseItems && $responseItems->getTotalResults()) {
|
||||
$hasResults = true;
|
||||
foreach ($responseSitePages->getContent() as $sitePage) {
|
||||
$site = $sitePage->site();
|
||||
if (!in_array ($site , $result)) {
|
||||
array_push($result, $site);
|
||||
}
|
||||
}
|
||||
}
|
||||
echo $this->partial('common/block-layout/list-of-sites', [
|
||||
'sites' => $result,
|
||||
'summaries' => 1,
|
||||
]);
|
||||
} else {
|
||||
/* display the results as normal */
|
||||
?>
|
||||
|
||||
<?php
|
||||
if ($responseSitePages && $responseSitePages->getTotalResults()):
|
||||
$hasResults = true;
|
||||
|
@ -50,6 +84,7 @@ if ($responseSitePages && $responseSitePages->getTotalResults()):
|
|||
]);
|
||||
?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
if ($responseItems && $responseItems->getTotalResults()):
|
||||
$hasResults = true;
|
||||
|
@ -64,8 +99,10 @@ if ($responseItems && $responseItems->getTotalResults()):
|
|||
]);
|
||||
?>
|
||||
<?php endif; ?>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
|
||||
<?php if (!$hasResults): ?>
|
||||
<p><?php echo $this->translate('No result found'); ?>
|
||||
<?php endif; ?>
|
||||
|
|
|
@ -4,6 +4,8 @@ $archiveSiteHelper = $this->getHelperPluginManager()->get('archiveSiteMeta');
|
|||
$archive_collections = $archiveSiteHelper->getCollections();
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<!-- <h2><?php echo sprintf($this->translate('Site page results for "%s"'), $fulltextSearch); ?></h2> -->
|
||||
|
||||
|
||||
|
|
|
@ -22,11 +22,14 @@ if (!$img_src) {
|
|||
</style>
|
||||
<script>
|
||||
<?php
|
||||
$_html = '<a href="'.$this->site->url().'">'.$this->site->title().'</a>';
|
||||
/*
|
||||
if ($this->site->title() != "Collections") {
|
||||
$_html = '<a href="'.$this->site->url().'">'.$this->site->title().'</a>';
|
||||
} else {
|
||||
$_html = $this->site->title();
|
||||
}
|
||||
*/
|
||||
?>
|
||||
$("#archive_page_title").html('<?php echo $_html ?>');
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue