DokuWikiで情報発信

個人での情報発信や社内での情報共有に便利なDokuWikiを紹介するサイトです。

ユーザ用ツール

サイト用ツール


サイドバー

目次

DokuWikiを理解

DokuWikiの構築

よく確認するページ

· 最終更新: 2018/10/15 by oreda admin



「テンプレート」に戻る

DokuWikiの組込フック(Include Hooks)で、別ファイルのHTML,CSS,JavaScriptを読み込む

概要

テンプレートディレクトリに指定のHTMLファイルを置くと、生成されるWikiページの所定の場所に、その内容が差し込まれる

ファイル名 HTMLが組み込まれる場所 利用例
meta.html <head>タグの内側 ・google adsenseのコード
・JavaScript
・CSS
pageheader.html ページの実コンテンツの上 広告ビッグバナー(728 x 90)
pagefooter.html ページの一番下 広告ビッグバナー(728 x 90)
sidebarheader.html (もしあれば)サイドバーの上部。
ただし、sidbarに直接書けばいいので、
このファイルに書く必要はない。
広告(300 x 250)
sidebarfooter.html (もしあれば)サイドバーの下部。
ただし、sidbarに直接書けばいいので、
このファイルに書く必要はない。
広告(300 x 250)
(ページに書けばいいので使わない)
header.html ページ名とwikiタイトルの下
footer.html </body>タグの直前、ページの最後尾

HTMLの例

<html lang="ja" dir="ltr" class="no-js">
 
<head>
    <meta charset="utf-8" />
    <title>タイトル</title>
    ●meta.html
</head>
 
 
<body>

<!-- ********** HEADER ********** -->
<div id="dokuwiki__header">
 
</div><!-- /header -->
 
                <!-- ********** ASIDE ********** -->
                <div id="dokuwiki__aside">
 
                </div><!-- /aside -->
 
 
            <!-- ********** CONTENT ********** -->
            <div id="dokuwiki__content">
 
            </div><!-- /content -->
 
 
<!-- ********** FOOTER ********** -->
<div id="dokuwiki__footer">
 
</div><!-- /footer -->

●footer.html
</body>

</html>

デフォルトテンプレートでの読み込みメモ

# dokuwiki/lib/tpl/dokuwiki/
# grep include *.php 
detail.php:    <?php tpl_includeFile('meta.html') ?>
detail.php:        <?php include('tpl_header.php') ?>
detail.php:                    <?php tpl_includeFile('pageheader.html') ?>
detail.php:                <?php tpl_includeFile('pagefooter.html') ?>
detail.php:        <?php include('tpl_footer.php') ?>
main.php:    <?php tpl_includeFile('meta.html') ?>
main.php:        <?php include('tpl_header.php') ?>
main.php:                <div id="dokuwiki__aside"><div class="pad aside include group">
main.php:                        <?php tpl_includeFile('sidebarheader.html') ?>
main.php:                        <?php tpl_include_page($conf['sidebar'], true, true) ?>
main.php:                        <?php tpl_includeFile('sidebarfooter.html') ?>
main.php:                    <?php tpl_includeFile('pageheader.html') ?>
main.php:                    <?php tpl_includeFile('pagefooter.html') ?>
main.php:        <?php include('tpl_footer.php') ?>
mediamanager.php:    <?php tpl_includeFile('meta.html') ?>
tpl_footer.php: * Template footer, included in the main and detail files
tpl_footer.php:tpl_includeFile('footer.html');
tpl_header.php: * Template header, included in the main and detail files
tpl_header.php:    <?php tpl_includeFile('header.html') ?>
# grep include *.php  |grep .html
detail.php:    <?php tpl_includeFile('meta.html') ?>
detail.php:                    <?php tpl_includeFile('pageheader.html') ?>
detail.php:                <?php tpl_includeFile('pagefooter.html') ?>
main.php:    <?php tpl_includeFile('meta.html') ?>
main.php:                        <?php tpl_includeFile('sidebarheader.html') ?>
main.php:                        <?php tpl_includeFile('sidebarfooter.html') ?>
main.php:                    <?php tpl_includeFile('pageheader.html') ?>
main.php:                    <?php tpl_includeFile('pagefooter.html') ?>
mediamanager.php:    <?php tpl_includeFile('meta.html') ?>
tpl_footer.php:tpl_includeFile('footer.html');
tpl_header.php:    <?php tpl_includeFile('header.html') ?>


利用例

  • meta.htmlにjavascriptを追加
  • 広告を表示


参考




· 最終更新: 2018/10/15 by oreda admin

ページ用ツール