Skip to content

Create a new hook to allow user to include a full view jumbotron to his pages #243

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions main.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<title><?php echo bootstrap3_page_browser_title() ?></title>
<script>(function(H){H.className=H.className.replace(/\bno-js\b/,'js')})(document.documentElement)</script>
<meta name="viewport" content="width=device-width,initial-scale=1" />
<meta property="og:url" content="<?php echo wl($ID, "", 1); ?>">
<?php echo tpl_favicon(array('favicon', 'mobile')) ?>
<?php tpl_includeFile('meta.html') ?>
<?php tpl_metaheaders() ?>
Expand All @@ -33,6 +34,7 @@
<body class="<?php echo trim(implode(' ', $body_classes)) ?>">

<header id="dokuwiki__header" class="dokuwiki container<?php echo (bootstrap3_is_fluid_container()) ? '-fluid' : '' ?>">
<?php require_once('tpl_jumbotron.php'); ?>
<?php tpl_includeFile('topheader.html') ?>
<?php require_once('tpl_navbar.php'); ?>
<?php tpl_includeFile('header.html') ?>
Expand Down
30 changes: 30 additions & 0 deletions tpl_jumbotron.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
/**
* DokuWiki Bootstrap3 Template: Jumbotron hook
*
* @link http://dokuwiki.org/template:bootstrap3
* @author Eric Maeker <eric@@maeker.fr>
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
*/

// must be run from within DokuWiki
if (!defined('DOKU_INC')) die();

// This jumbotron hook allow users to include full view jumbotron to their
// landing pages. Config vars: showLandingPage and landingPages must be defined accordingly.
// On landing pages, the jumbotron is included before the dokuwiki page. This allow user
// to create a beautifull "one picture" landing page to their website.

// Show jumbotron on landing pages only
if (bootstrap3_conf('showLandingPage')
&& (bool) preg_match(bootstrap3_conf('landingPages'), $ID)) {
// Do not include jumbotron on administratives panels
if ($_GET['do'] == '') {
tpl_include_page('jumbotron', 1, 1);
} else {
// Here you can add a padding-top empty div
}
} else {
// Here you can add a padding-top empty div
}
?>