List collections with vue component #40

Merged
chris merged 4 commits from collection-list into develop 2021-11-10 13:59:26 +01:00
2 changed files with 16 additions and 9 deletions
Showing only changes of commit dafe41912d - Show all commits

1
asset/js/archive-list.js Symbolic link
View File

@ -0,0 +1 @@
../../../../../archive-lister/dist/archive-list.js

View File

@ -4,20 +4,26 @@ $archiveSiteHelper = $this->getHelperPluginManager()->get('archiveSiteMeta');
<?php <?php
$data = []; $collections = [];
foreach($sites as $site){ foreach($sites as $site){
$site_meta_values = $archiveSiteHelper->getSiteMetaValues($site); $site_data = $archiveSiteHelper->getSiteMetaValues($site);
$site_meta_values['url'] = $site->siteUrl(); $site_data['url'] = $site->siteUrl();
$site_meta_values['title'] = $site->title(); $site_data['title'] = $site->title();
$site_meta_values['summay'] = nl2br($this->escapeHtml($site->summary())); $site_data['summary'] = nl2br($this->escapeHtml($site->summary()));
array_push($data, $site_meta_values); array_push($collections, $site_data);
} }
//$collections = json_encode($collections, JSON_UNESCAPED_SLASHES);
//$collections = json_encode($collections, JSON_HEX_APOS);
//$collections = htmlspecialchars(json_encode($collections), ENT_QUOTES, 'UTF-8');
//$collections = str_replace("'", "\'", $collections);
$collections = htmlentities(json_encode($collections, JSON_HEX_QUOT), ENT_QUOTES, 'UTF-8');
//$collections = json_encode($collections);
?> ?>
<div data-vue-component="archive-list" <div data-vue-component="archive-list"
data-collections='<?= json_encode($data, JSON_UNESCAPED_SLASHES) ?>'> data-collections='<?= $collections ?>'>
</div> </div>
<script src="/themes/archive/asset/js/archive-list.js"></script>>
<script src="/themes/archive/asset/js/archive-list.js"></script>