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