ajwillia-ms pushed a commit to branch master.

http://git.enlightenment.org/website/www.git/commit/?id=e1bb41cd928f5663d8aab01c378004787b5f4dd1

commit e1bb41cd928f5663d8aab01c378004787b5f4dd1
Author: Andy Williams <[email protected]>
Date:   Tue Oct 24 13:10:22 2017 +0100

    sidebar: Re-enable this standard functionality
    
    This means if a sidebar file exists in a namespace or parent namespace
    it will be rendered alongside the document.
    Way good for index cutouts or workflows
---
 public_html/lib/tpl/e/css/modifications.css | 10 ++++++++++
 public_html/lib/tpl/e/main.php              | 17 +++++++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/public_html/lib/tpl/e/css/modifications.css 
b/public_html/lib/tpl/e/css/modifications.css
index b2c3c236..072ad17e 100644
--- a/public_html/lib/tpl/e/css/modifications.css
+++ b/public_html/lib/tpl/e/css/modifications.css
@@ -90,6 +90,16 @@ h1, h2, h3, h4, h5, h6,
    }
 }
 
+#dokuwiki__aside {
+   float: right;
+   position: relative;
+   background-color: #282828;
+   padding-left: 10px;
+   padding-right: 10px;
+   margin-right: 15px;
+   min-width: 250px;
+}
+
 @media screen and (max-width: 768px) {
    table.columns-plugin {
       border: none;
diff --git a/public_html/lib/tpl/e/main.php b/public_html/lib/tpl/e/main.php
index e0eae4e0..2f1fd48c 100644
--- a/public_html/lib/tpl/e/main.php
+++ b/public_html/lib/tpl/e/main.php
@@ -18,6 +18,9 @@ $showTools = !tpl_getConf('hideTools') || ( 
tpl_getConf('hideTools') && $_SERVER
 # this affects our grid layout later ( see 'if ($showTOC)' )
 $showTOC = ($ACT == "show") && tpl_toc(true);
 
+$hasSidebar = page_findnearest($conf['sidebar']);
+$showSidebar = $hasSidebar && ($ACT=='show');
+
 ?><!DOCTYPE html>
 <html lang="<?php echo $conf['lang'] ?>" dir="<?php echo $lang['direction'] 
?>">
 <head>
@@ -94,6 +97,20 @@ $showTOC = ($ACT == "show") && tpl_toc(true);
                                <?php } else { ?>
                        <div class="col-md-11" id="dokuwiki__content">
                                <?php } ?>
+
+                       <?php if($showSidebar): ?>
+                               <!-- ********** ASIDE ********** -->
+                               <div id="dokuwiki__aside" 
class="bs-sidebar"><div class="nav pad aside include group">
+                                       <h3 class="toggle">Navigation</h3>
+                                       <div class="content">
+                                               <?php tpl_flush() ?>
+                                               <?php 
tpl_includeFile('sidebarheader.html') ?>
+                                               <?php 
tpl_include_page($conf['sidebar'], true, true) ?>
+                                               <?php 
tpl_includeFile('sidebarfooter.html') ?>
+                                       </div>
+                               </div></div><!-- /aside -->
+                       <?php endif; ?>
+
                        <div class="page">
                                                <?php tpl_flush(); ?>
                                                <?php tpl_content(false); ?>

-- 


Reply via email to