adds site index page

This commit is contained in:
buttle 2021-04-26 16:08:13 +02:00
parent e1e1e7dd50
commit 9c73160a7d
3 changed files with 153 additions and 1 deletions

111
view/layout/exhibit.phtml Normal file
View File

@ -0,0 +1,111 @@
<?php
$escape = $this->plugin('escapeHtml');
$stylesheet = $this->themeSetting('stylesheet');
$this->htmlElement('html')->setAttribute('lang', $this->lang());
$this->headMeta()->setCharset('utf-8');
$this->headMeta()->appendName('viewport', 'width=device-width, initial-scale=1');
$this->headTitle($this->setting('installation_title', 'Omeka S'))->setSeparator(' · ');
if (isset($stylesheet)) {
$this->headLink()->prependStylesheet($this->assetUrl("css/$stylesheet.css"));
} else {
$this->headLink()->prependStylesheet($this->assetUrl('css/default.css'));
}
$this->headLink()->prependStylesheet($this->assetUrl('css/iconfonts.css', 'Omeka'));
$this->headScript()->prependFile('//cdn.jsdelivr.net/npm/foundation-sites@6.5.3/dist/js/foundation.min.js', 'text/javascript', [
'integrity' => 'sha256-/PFxCnsMh+nTuM0k3VJCRch1gwnCfKjaP8rJNq5SoBg= sha384-9ksAFjQjZnpqt6VtpjMjlp2S0qrGbcwF/rvrLUg2vciMhwc1UJJeAAOLuJ96w+Nj sha512-UMSn6RHqqJeJcIfV1eS2tPKCjzaHkU/KqgAnQ7Nzn0mLicFxaVhm9vq7zG5+0LALt15j1ljlg8Fp9PT1VGNmDw==',
'crossorigin' => 'anonymous'
]);
$this->headScript()->prependFile($this->assetUrl('js/global.js', 'Omeka'));
$this->headScript()->prependFile($this->assetUrl('vendor/jquery/jquery.min.js', 'Omeka'));
$this->trigger('view.layout');
$title = $this->pageTitle($site->title());
$userBar = $this->userBar();
$navLayout = ($this->themeSetting('nav_layout')) ? $this->themeSetting('nav_layout') : 'dropdown';
$this->htmlElement('body')->appendAttribute('class', $navLayout . '-menu');
if ($userBar) {
$this->htmlElement('body')->appendAttribute('class', 'user-bar');
}
$logo = $this->themeSettingAssetUrl('logo');
if ($logo):
$title = '<img src="' . $this->escapeHtml($logo) . '">';
endif;
?>
<?php echo $this->doctype(); ?>
<?php echo $this->htmlElement('html'); ?>
<head>
<?php echo $this->headMeta(); ?>
<?php echo $this->headTitle(); ?>
<?php echo $this->headLink(); ?>
<?php echo $this->headStyle(); ?>
<?php echo $this->headScript(); ?>
</head>
<?php echo $this->htmlElement('body'); ?>
<div id="offCanvas" class="off-canvas position-left" data-off-canvas>
<?php echo $site->publicNav()->menu()->setPartial('common/foundation-navigation.phtml')->renderPartialWithParams(['layout' => 'vertical']); ?>
<div class="search">
<?php echo $this->partial('common/search-form'); ?>
</div>
</div>
<div class="off-canvas-content" data-off-canvas-content>
<a id="skipnav" href="#content"><?php echo $this->translate('Skip to main content'); ?></a>
<?php echo $userBar; ?>
EXHIBIT
<img id="archive_header_img" />
<?php
//echo $page;
//echo $this->container;
/*
foreach ($this->container as $page) {
print($page->id);
}
*/
/*
$nav = $site->publicNav();
$container = $nav->getContainer();
$activePage = $nav->findActive($container);
$slug = $activePage['page']->getParams()['page-slug'];
print($slug);
foreach ($activePage['page']->getParams() as $key => $param) {
print($key.' '.$param);
}
#$page_id = $activePage->id();
#print($page_id);
*/
//$header_image = $this->getHelperPluginManager()->get('pageMeta')->getMetaImage($this);
?>
<header>
<?php if ($navLayout == 'vertical'): ?>
<?php echo $this->partial('common/header-vertical'); ?>
<?php else: ?>
<?php echo $this->partial('common/header-dropdown'); ?>
<?php endif; ?>
</header>
<div id="content" role="main">
<?php echo $this->content; ?>
</div>
<footer>
<?php if ($footerContent = $this->themeSetting('footer')): ?>
<?php echo $footerContent; ?>
<?php else: ?>
<?php echo $this->translate('Powered by Omeka S'); ?>
<?php endif; ?>
</footer>
</div>
<script>
$(document).foundation();
</script>
</body>
</html>

View File

@ -0,0 +1,41 @@
<?php
$translate = $this->plugin('translate');
$this->htmlElement('body')->appendAttribute('class', 'site browse front');
$title = $this->setting('installation_title', 'Omeka S');
$subtitle = $translate('Sites');
$this->headTitle($subtitle);
?>
<h1><?php echo $this->hyperlink($title, $this->url('top', ['action' => 'index'])); ?></h1>
<?php if ($sites): ?>
<?php echo $this->partial(
'common/cross-site-search/fulltext-form.phtml',
['action' => $this->url('search', ['action' => 'results'], true)]
); ?>
Archive site list
<h2 class="site-list-heading"><?php echo $subtitle; ?></h2>
<div class="site-list">
<?php
foreach ($sites as $site):
echo $this->partial('common/site-list-entry', ['site' => $site, 'showSummary' => true]);
endforeach;
?>
</div>
<?php echo $this->pagination(); ?>
<?php endif; ?>
<p><?php echo sprintf(
$translate('Go to the %1$s to start working with %2$s.'),
$this->hyperlink($translate('Admin dashboard'), $this->url('admin')),
$title
); ?></p>

View File

@ -7,7 +7,7 @@ $showPagePagination = $this->siteSetting('show_page_pagination', true);
<?php
// set header images
$img_src = $this->getHelperPluginManager()->get('pageMeta')->getMetaImage($page);
$img_src = $this->getHelperPluginManager()->get('pageMeta')->getPageImage($page);
if ($img_src) {
?>
<style>