fixes item and media page headers

This commit is contained in:
buttle 2021-05-31 15:26:34 +02:00
parent 1da5e9f4ea
commit 78606bad26
4 changed files with 43 additions and 60 deletions

View File

@ -6,21 +6,19 @@ $hasResults = false;
<!-- arc-hive insert begins --> <!-- arc-hive insert begins -->
<?php <?php
//$site->pages();
// set header image
$img_src = $this->getHelperPluginManager()->get('archiveSiteMeta')->getSiteImage($site); $img_src = $this->getHelperPluginManager()->get('archiveSiteMeta')->getSiteImage($site);
if (!$img_src) { if (!$img_src) {
$img_src = '/themes/archive/asset/img/default-header-image.jpg'; $img_src = '/themes/archive/asset/img/default-header-image.jpg';
} }
?> ?>
<style> <style>
#archive_header_img { #archive_header_img {
background:url("<?= $img_src ?>") no-repeat; background:url("<?= $img_src ?>") no-repeat;
width:100%; width:100%;
height:100px; height:100px;
} }
</style> </style>
<script> <script>
<?php <?php

View File

@ -7,29 +7,24 @@ $itemMedia = $item->media();
$showLayout = $this->themeSetting('show_layout'); $showLayout = $this->themeSetting('show_layout');
?> ?>
<!-- arc-hive insert begins -->
<?php <?php
$site->pages(); $site->pages();
// set header image // set header image
$img_src = $this->getHelperPluginManager()->get('archiveSiteMeta')->getSiteImage($site); $img_src = $this->getHelperPluginManager()->get('archiveSiteMeta')->getSiteImage($site);
if ($img_src) { if (!$img_src) {
$img_src = '/themes/archive/asset/img/default-header-image.jpg';
}
?> ?>
<style> <style>
#archive_header_img { #archive_header_img {
background:url("<?= $img_src ?>") no-repeat; background:url("<?= $img_src ?>") no-repeat;
width:100%; width:100%;
height:100px; height:100px;
} }
</style> </style>
<?php } else { ?>
<style>
#archive_header_img {
display: none;
}
</style>
<?php } ?>
<script> <script>
/*
<?php <?php
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>';
@ -38,8 +33,8 @@ if ($img_src) {
} }
?> ?>
$("#archive_page_title").html('<?php echo $_html ?>'); $("#archive_page_title").html('<?php echo $_html ?>');
*/
</script> </script>
<!-- arc-hive insert ends -->
<div class="resource-title"> <div class="resource-title">

View File

@ -3,27 +3,22 @@ $translate = $this->plugin('translate');
?> ?>
<?php $this->htmlElement('body')->appendAttribute('class', 'media resource show'); ?> <?php $this->htmlElement('body')->appendAttribute('class', 'media resource show'); ?>
<!-- arc-hive insert begins -->
<?php <?php
$site->pages(); //$site->pages();
// set header image // set header image
$img_src = $this->getHelperPluginManager()->get('archiveSiteMeta')->getSiteImage($site); $img_src = $this->getHelperPluginManager()->get('archiveSiteMeta')->getSiteImage($site);
if ($img_src) { if (!$img_src) {
$img_src = '/themes/archive/asset/img/default-header-image.jpg';
}
?> ?>
<style> <style>
#archive_header_img { #archive_header_img {
background:url("<?= $img_src ?>") no-repeat; background:url("<?= $img_src ?>") no-repeat;
width:100%; width:100%;
height:100px; height:100px;
} }
</style> </style>
<?php } else { ?>
<style>
#archive_header_img {
display: none;
}
</style>
<?php } ?>
<script> <script>
<?php <?php
@ -35,7 +30,7 @@ if ($img_src) {
?> ?>
$("#archive_page_title").html('<?php echo $_html ?>'); $("#archive_page_title").html('<?php echo $_html ?>');
</script> </script>
<!-- arc-hive insert ends -->
<div class="resource-title"> <div class="resource-title">

View File

@ -7,25 +7,20 @@ $showPagePagination = $this->siteSetting('show_page_pagination', true);
<!-- arc-hive insert begins --> <!-- arc-hive insert begins -->
<?php <?php
$site->pages(); //$site->pages();
// set header image // set header image
$img_src = $this->getHelperPluginManager()->get('headerImage')->getImage($page); $img_src = $this->getHelperPluginManager()->get('headerImage')->getImage($page);
if ($img_src) { if (!$img_src) {
$img_src = '/themes/archive/asset/img/default-header-image.jpg';
}
?> ?>
<style> <style>
#archive_header_img { #archive_header_img {
background:url("<?= $img_src ?>") no-repeat; background:url("<?= $img_src ?>") no-repeat;
width:100%; width:100%;
height:100px; height:100px;
} }
</style> </style>
<?php } else { ?>
<style>
#archive_header_img {
display: none;
}
</style>
<?php } ?>
<script> <script>
<?php <?php
if ($this->site->title() != "Collections") { if ($this->site->title() != "Collections") {