app/Resources/views/layout.html.php line 174

Open in your IDE?
  1. <?php
  2. /**
  3.  * @var \Pimcore\Templating\PhpEngine $this
  4.  * @var \Pimcore\Templating\PhpEngine $view
  5.  * @var \Pimcore\Templating\GlobalVariables $app
  6.  */
  7. use Pimcore\Model\Document;
  8. use Pimcore\Model\Document\Page;
  9. ?><!DOCTYPE html>
  10. <html lang="<?= $this->getLocale() ?>">
  11. <head>
  12.     <meta charset="utf-8">
  13.     <link rel="icon" type="image/png" href="/pimcore/static/img/favicon/favicon-32x32.png"/>
  14.     <?php
  15.     // portal detection => portal needs an adapted version of the layout
  16.     $isPortal $this->isPortal ?: false;
  17.     /** @var Document|Page $document */
  18.     $document $this->document;
  19.     // output the collected meta-data
  20.     if (!$document) {
  21.         // use "home" document as default if no document is present
  22.         $document Document::getById(1);
  23.         $this->document $document;
  24.     }
  25.     // resolve links to their target
  26.     if ($document instanceof Document\Link) {
  27.         $document $document->getObject();
  28.         $this->document $document;
  29.     }
  30.     if ($document instanceof Document\Page && $document->getTitle()) {
  31.         // use the manually set title if available
  32.         $this->headTitle()->set($document->getTitle());
  33.     }
  34.     if ($document instanceof Document\Page && $document->getDescription()) {
  35.         // use the manually set description if available
  36.         $this->headMeta()->setDescription($document->getDescription());
  37.     }
  38.     $this->headTitle()->append("pimcore Demo");
  39.     $this->headTitle()->setSeparator(" : ");
  40.     echo $this->headTitle();
  41.     echo $this->headMeta();
  42.     ?>
  43.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  44.     <!-- Le styles -->
  45.     <?php
  46.     // we use the view helper here to have the cache buster functionality
  47.     $this->headLink()->appendStylesheet('/static/bootstrap/css/bootstrap.css');
  48.     $this->headLink()->appendStylesheet('/static/css/global.css');
  49.     $this->headLink()->appendStylesheet('/static/lib/video-js/video-js.min.css'"screen");
  50.     $this->headLink()->appendStylesheet('/static/lib/magnific/magnific.css'"screen");
  51.     $this->headLink()->appendStylesheet('/static/css/print.css'"print");
  52.     if ($this->editmode) {
  53.         $this->headLink()->appendStylesheet('/static/css/editmode.css'"screen");
  54.     }
  55.     ?>
  56.     <?= $this->headLink(); ?>
  57.     <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
  58.     <!--[if lt IE 9]>
  59.     <script src="/static/js/html5shiv.js"></script>
  60.     <script src="/static/js/respond.min.js"></script>
  61.     <![endif]-->
  62. </head>
  63. <body class="<?= $isPortal "portal-page" '' ?>">
  64. <div class="navbar-wrapper">
  65.     <?php
  66.     $mainNavStartNode $document->getProperty('mainNavStartNode');
  67.     if (!$mainNavStartNode) {
  68.         $mainNavStartNode Document::getById(1);
  69.     }
  70.     ?>
  71.     <div class="container">
  72.         <div class="navbar navbar-inverse navbar-static-top">
  73.             <div class="container">
  74.                 <div class="navbar-header">
  75.                     <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
  76.                         <span class="icon-bar"></span>
  77.                         <span class="icon-bar"></span>
  78.                         <span class="icon-bar"></span>
  79.                     </button>
  80.                     <a class="navbar-brand" href="<?= $mainNavStartNode?>">
  81.                         <img src="/static/img/logo-white.svg" alt="pimcore Demo">
  82.                     </a>
  83.                 </div>
  84.                 <div class="navbar-collapse collapse">
  85.                     <?php
  86.                     $mainNavigation $this->navigation()->buildNavigation($document$mainNavStartNode);
  87.                     echo $this->navigation()->render($mainNavigation'menu''renderMenu', [
  88.                         'maxDepth' => 1,
  89.                         'ulClass'  => 'nav navbar-nav'
  90.                     ]);
  91.                     ?>
  92.                     <ul class="nav navbar-nav navbar-right">
  93.                         <?= $this->template('Includes/login.html.php'); ?>
  94.                         <?= $this->template('Includes/language.html.php'); ?>
  95.                     </ul>
  96.                 </div>
  97.             </div>
  98.         </div>
  99.     </div>
  100. </div>
  101. <?php if (!$isPortal): ?>
  102.     <?= $this->template('Includes/jumbotron.html.php'?>
  103.     <div id="content" class="container">
  104.         <?php
  105.         $hideLeftNav     $document->getProperty('leftNavHide') || $this->getViewParameter('hideLeftNav'false);
  106.         $showBreadcrumbs $this->getViewParameter('showBreadcrumbs'true);
  107.         $mainColClass 'col-md-9 col-md-push-3';
  108.         if ($hideLeftNav) {
  109.             $mainColClass 'col-md-12';
  110.         }
  111.         ?>
  112.         <div class="<?= $mainColClass ?>">
  113.             <?php $this->slots()->output('_content'?>
  114.             <?php if ($showBreadcrumbs): ?>
  115.                 <div class="breadcrumb-footer">
  116.                     <a href="/"><?= $this->translate('Home'); ?></a> &gt;
  117.                     <?php
  118.                     /** @var \Pimcore\Navigation\Renderer\Breadcrumbs $breadcrumbsRenderer */
  119.                     $breadcrumbsRenderer $this->navigation()->getRenderer('breadcrumbs');
  120.                     $breadcrumbsRenderer->setMinDepth(null);
  121.                     echo $breadcrumbsRenderer->render($mainNavigation);
  122.                     ?>
  123.                 </div>
  124.             <?php endif; ?>
  125.         </div>
  126.         <?php if (!$hideLeftNav): ?>
  127.             <div class="col-md-3 col-md-pull-9 sidebar">
  128.                 <div class="bs-sidebar hidden-print affix-top" role="complementary">
  129.                     <?php
  130.                     $leftNavStartNode $document->getProperty('leftNavStartNode');
  131.                     if (!$leftNavStartNode) {
  132.                         $leftNavStartNode $mainNavStartNode;
  133.                     }
  134.                     $leftNav $this->navigation()->buildNavigation($document$leftNavStartNode);
  135.                     ?>
  136.                     <h3><?= $leftNavStartNode->getProperty('navigation_name'); ?></h3>
  137.                     <?= $this->navigation()->render($leftNav'menu''renderMenu', [
  138.                         'ulClass'                          => 'nav bs-sidenav',
  139.                         'expandSiblingNodesOfActiveBranch' => true
  140.                     ]) ?>
  141.                 </div>
  142.                 <?= $this->inc($document->getProperty('sidebar')); ?>
  143.             </div>
  144.         <?php endif; ?>
  145.     </div>
  146. <?php else: ?>
  147.     <?php $this->slots()->output('_content'?>
  148. <?php endif; ?>
  149. <?php
  150. // include a document-snippet - in this case the footer document
  151. echo $this->inc('/' $this->getLocale() . '/shared/includes/footer');
  152. // global scripts, we use the view helper here to have the cache buster functionality
  153. $this->headScript()->prependFile('/static/bootstrap/js/bootstrap.js');
  154. $this->headScript()->prependFile('/static/js/jquery-1.11.0.min.js');
  155. $this->headScript()->appendFile('/static/lib/magnific/magnific.js');
  156. $this->headScript()->appendFile('/static/lib/video-js/video.js');
  157. $this->headScript()->appendFile('/static/js/srcset-polyfill.min.js');
  158. echo $this->headScript();
  159. ?>
  160. <script>
  161.     videojs.options.flash.swf = "/static/lib/video-js/video-js.swf";
  162. </script>
  163. <script>
  164.     // main menu
  165.     $(".navbar-wrapper ul.nav>li>ul").each(function () {
  166.         var li = $(this).parent();
  167.         var a = $("a.main", li);
  168.         $(this).addClass("dropdown-menu");
  169.         li.addClass("dropdown");
  170.         a.addClass("dropdown-toggle");
  171.         li.on("mouseenter", function () {
  172.             $("ul", $(this)).show();
  173.         });
  174.         li.on("mouseleave", function () {
  175.             $("ul", $(this)).hide();
  176.         });
  177.     });
  178.     // side menu
  179.     $(".bs-sidenav ul").each(function () {
  180.         $(this).addClass("nav");
  181.     });
  182.     // gallery carousel: do not auto-start
  183.     $('.gallery').carousel('pause');
  184.     // tabbed slider text
  185.     var clickEvent = false;
  186.     $('.tabbed-slider').on('click', '.nav a', function () {
  187.         clickEvent = true;
  188.         $('.nav li').removeClass('active');
  189.         $(this).parent().addClass('active');
  190.     }).on('slid.bs.carousel', function (e) {
  191.         if (!clickEvent) {
  192.             var count = $('.nav').children().length - 1;
  193.             var current = $('.nav li.active');
  194.             current.removeClass('active').next().addClass('active');
  195.             var id = parseInt(current.data('slide-to'));
  196.             if (count == id) {
  197.                 $('.nav li').first().addClass('active');
  198.             }
  199.         }
  200.         clickEvent = false;
  201.     });
  202.     $("#portalHeader img, #portalHeader .item, #portalHeader").height($(window).height());
  203.     <?php if(!$this->editmode): ?>
  204.     // center the caption on the portal page
  205.     $("#portalHeader .carousel-caption").css("bottom", Math.round(($(window).height() - $("#portalHeader .carousel-caption").height()) / 3) + "px");
  206.     $(document).ready(function () {
  207.         // lightbox (magnific)
  208.         $('a.thumbnail').magnificPopup({
  209.             type: 'image',
  210.             gallery: {
  211.                 enabled: true
  212.             }
  213.         });
  214.         $(".image-hotspot").tooltip();
  215.         $(".image-marker").tooltip();
  216.     });
  217.     <?php endif; ?>
  218. </script>
  219. </body>
  220. </html>