<?php
$this->htmlElement('body')->appendAttribute('class', 'page ' . $page->slug());
$this->pageTitle($page->title(), 2);
$showPagePagination = $this->siteSetting('show_page_pagination', true);
?>


<!-- arc-hive page header-image insert begins -->
<?php
/*
  $img_src has already been set at view/common/header-default.phtml
  We override it here because a page may have it's own header image
*/
$img_src = null;
  $img_src = $this->getHelperPluginManager()->get('headerImage')->getImage($page);
  if (!$img_src) {
    $img_src = $this->assetUrl('img/default-ARC-HIVE-hero-image.jpg');
  }
  ?>
  <style>
  .arc-page-header-img {
     content: url("<?= $img_src ?>");
  }
  </style>
  <?php
?>
<!-- arc-hive page header-image insert ends -->

<?php
$nav = $site->publicNav();
$container = $nav->getContainer();
$activePage = $nav->findActive($container);
if ($activePage):
?>
    <?php if ($activePage['depth'] !== 0): ?>
    <nav class="breadcrumbs">
      <?php echo $nav->breadcrumbs()->setPartial('common/foundation-breadcrumbs'); ?>
    </nav>
    <?php endif; ?>
<?php endif; ?>


<!--
<?php
  $pages = $this->getHelperPluginManager()->get('archiveSiteMeta')->getPages('exhibit');
  foreach ($pages as $key => $value) {
    print($key);
    print('<br />');
    print("--".$value."--");
    print('<br />');
  }
?>
-->

<!-- archive menu -->
<?php
/*
  echo $this->partial('common/search-form');
  echo $nav->menu()->renderSubMenu();
*/
?>


<?php if ($activePage): ?>
    <?php if ($this->displayNavigation && $activePage['page']->hasPages()): ?>
    <nav class="sub-menu wide" data-sticky-container>
        <div class="no-sticky" no-data-sticky no-data-anchor="blocks">
            <?php echo $nav->menu()->setUlClass('horizontal menu')->renderSubMenu(); ?>
        </div>
    </nav>
    <?php endif; ?>
<?php endif; ?>


<?php $this->trigger('view.show.before'); ?>
<div id="blocks" class="blocks">
    <?php echo $this->content; ?>
</div>

<?php if ($this->site->title() != "Collections") { ?>
  <button class="end_of_page_button" onclick="window.location.href = '/'">
    Collection index
  </button>
<?php } ?>




<?php $this->trigger('view.show.after'); ?>
<?php /* if ($showPagePagination): */ ?>
<?php if (1 == 0): ?>
<?php echo $this->sitePagePagination(); ?>
<?php endif; ?>
