Table of Contents

DokuWiki Configuration

Admin, extensions:
uninstall active directory auth plugin
uninstall ldap auth plugin
uninstall mysql auth plugin
uninstall postgresql auth plugin
uninstall popularity feedback plugin

Install changes plugin. manually via:
https://github.com/cosmocode/changes/zipball/master

Install EditX Plugin by danny0838 (Danny Lin)
simplenavi plugin by Andreas Gohr

Create page sidebar and put:

{{simplenavi>}}

Create page start and put:

Something introduction etc...

{{changes>type = create&render = list(dayheaders)}}

~~NOCACHE~~

Install xbr plugin, enable it in admin config, change the renderer_xhtml setting to 'xbr'.
This renders newlines in entry source without need for double-backslashes.

Go to admin, config settings:

Change Display, Recent changes to keep to 60

Change Display, showuseras to User's Full Name (to protect login user name)

Change Display, use first heading for pagenames to Navigation Only

Change Display, hidepages and enter sidebar

Change Links, target window for external links to _blank

Change changes, oldest changes to show to 60*24*60*60

Theme Adjustment

The easiest way to adjust the theme to a darker version is to create the file “style.local.ini” and place it into the dokuwiki/lib/tpl/dokuwiki directory. (Doesn't seem to work after update to latest wiki version. Using style addon stores it as style.ini in /web/dokuwiki/conf/tpl/dokuwiki instead).

An example file with a darker theme ini file is below. Furthermore, replacing the favicon.ico, logo.png and apple-touch-icon.png in the template image folder with alternative versions and overwriting the dokuwiki-128.png file in the media manager will change the logo and favicon. You can also just store these in the 'root' or the 'wiki' section without adjusting or replacing the template files.

Here are the images for the blue world icon:


dokuwiki-128.png
logo.png
apple-touch-icon.png
favicon.ico

/web/dokuwiki/conf/tpl/dokuwiki/style.ini
[replacements]
;--------------------------------------------------------------------------
;------ guaranteed dokuwiki color placeholders that every plugin can use

; main text and background colors
__text__            = "#eeeeee"
__background__      = "#222222"
; alternative text and background colors
__text_alt__        = "#dddddd"
__background_alt__  = "#444444"
; neutral text and background colors
__text_neu__        = "#cccccc"
__background_neu__  = "#333333"
; border color
;__border__          = "#f90"
__border__          = "#90b3da"

; highlighted text (e.g. search snippets)
__highlight__       = "#aaaa66"

;--------------------------------------------------------------------------
 
__background_site__ = "#000000"

; these are used for links
;__link__            = "#ff9900"
__link__            = "#90b3da"
__existing__        = "#ffff88"
__missing__         = "#ff4433"

; site and sidebar widths
__site_width__      = "100%"
__sidebar_width__   = "22%"

Hack for edittable with dark theme:

/web/dokuwiki/conf/userstyle.css
.handsontable td {
    color: #222;
}

Remove footer buttons and license:

/web/dokuwiki/lib/tpl/dokuwiki/tpl_footer.php
#remove everything between
<!-- ********** FOOTER ********** -->
#and
<!-- /footer -->

Remove Media Manager link for non-logged-in/view-only users:

/web/dokuwiki/lib/tpl/dokuwiki/tpl_header.php
#surround:
                        tpl_action('admin', 1, 'li');
                        tpl_action('profile', 1, 'li');
                        tpl_action('register', 1, 'li');
                        tpl_action('login', 1, 'li');
 
#with
if ($INFO['isadmin'] {
#and 
}

For 2020 Hogfather templates should be updated to replace the 4 tpl_action lines with:

                        echo (new \dokuwiki\Menu\UserMenu())->getListItems('action ');

and the similar action line in site-tools under the search form should contain:

                <?php 
                    if (!empty($_SERVER['REMOTE_USER'])) {
                        echo (new \dokuwiki\Menu\SiteMenu())->getListItems('action ', false);
                    }
                ?>

Geshi Syntax Highlight changes for dark theme:
add file /web/dokuwiki/lib/tpl/dokuwiki/css/_geshi_dark.less

/web/dokuwiki/lib/tpl/dokuwiki/css/_geshi_dark.less
/**
 * This file provides styles for syntax highlighting in dark mode
 * Syntax highlighting is done by GeShi
 * It doesn't change the default style light theme style
 */
 
@brackets: #bfbfbf;
@comments: #7a7a75;
@strings: #ff4444;
@methods: #ffffff;
@methods2: #ffcc66;
@keyword1: #99ee00;
@keyword2: #eeaa22;
@keyword3: #dd88ff;
@keyword4: #ff7744;
@operators: #44ffbb;
@numbers: #ff2288;
@variables: #88c0ff;
@variables2: #ccddff;
@variables5: #ddddff;
@lines: #252525;
@lines2: #272727;
@lines3: var(--background_site);
@lines-xtra: #494d26;
 
.dokuwiki{
 
    /* lines        */
    .li1 {
        background: @lines;
    }
    .li2 {
        background: @lines2;
    }
    .li1 .de1 {
        background: @lines3;
    }
    .li1.ln-xtra .de1, .ln-xtra{
        background: @lines-xtra;
    }
 
    /* brackets     */
    .br0 {
        color: @brackets;
    }
    /* comments     */
    .co0, .co1, .coMULTI {
        color: @comments;
    }
 
    /* strings      */
    .st0, .st_h {
        color: @strings;
    }
 
    /* methods      */
    .me0, .me1 {
        color: @methods;
    }
    .me2 {
        color: @methods2;
    }
 
    /* keywords     */
    .kw1 {
        color: @keyword1;
    }
    .kw2 {
        color: @keyword2;
    }
    .kw3 {
        color: @keyword3;
    }
    .kw4 {
        color: @keyword4;
    }
 
    /* operators        */
    .sy0 {
        color: @operators;
    }
 
    /* numbers      */
    .nu0 {
        color: @numbers;
    }
 
    /* variables        */
    .re0, .re1, .re3, .re4 {
        color: @variables;
    }
    .re2 {
        color: @variables2;
    }
    .re5 {
        color: @variables5;
    }
 
 
}
 
/* dark theme and automatic is switched off*/
&:root[theme="dokuwiki"] {
    .dokuwiki();
}
 
/* User prefers dark theme and automatic is switched on*/
@media (prefers-color-scheme: dark){
    &:root[theme="auto"] {
        .dokuwiki();
    }
}

edit /web/dokuwiki/lib/tpl/dokuwiki/style.ini and add to the stylesheets section

/web/dokuwiki/lib/tpl/dokuwiki/style.ini
css/_geshi_dark.less      = screen

Add icon for Shortcut on Homescreen on Android

vi lib/tpl/dokuwiki/main.php

insert after line 23 relating to favicon:

<?php
    $look = array(':wiki:apple-touch-icon.png', ':apple-touch-icon.png', 'images/apple-touch-icon.png');
    echo '<link rel="apple-touch-icon-precomposed" href="'.tpl_getMediaFile($look).'" />'.NL;
?>

Allow additional file types

cd dokuwiki/conf
cp mime.conf mime.local.conf
vi mime.local.conf
#delete all but the text files towards the end of the file and enable them
#add json text/json

Blank page issue after upgrade

https://www.dokuwiki.org/faq:blankpage

Changes & Pagelist plugin

https://www.dokuwiki.org/plugin:pagelist

Here are the most recent changes and additions:
{{changes>count=30&type = create, edit, minor&render = pagelist(header,nouser)}}

Adjustment hack to show parent namespace:
dokuwiki/lib/plugins/pagelist/helper.php line 656 function printPageCell (as of Feb 2024)

// produce output
        $parentnamespace = getNS($id);
        if(useHeading('navigation')) {
            // get page title
            $parenttitle = p_get_first_heading($parentnamespace.":start", METADATA_RENDER_USING_SIMPLE_CACHE);
            if($parenttitle) {
                $parentnamespace = $parenttitle;
            }
        }
        if($parentnamespace!="") {
            $parentnamespace.=' -> ';
        }
        $section = !empty($this->page['section']) ? '#' . $this->page['section'] : '';
        $content = '<a href="' . wl($id) . $section . '" class="' . $class . '" title="' . $id . '"  data-wiki-id="' . $id . '">' . $parentnamespace.$title . '</a>';
        if ($this->style == 'list') {
            $content = '<ul><li>' . $content . '</li></ul>';
        }
        return $this->printCell('page', $content);
    }

Install plugins via CLI

Examples to install plugins via the CLI by name (available) or specific ones by URL (available in releases after Sept 2021).

php bin/plugin.php extension install https://github.com/.../support_keycloak10.zip # installs from the URL
php bin/plugin.php extension install addnewpage # finds the download URL, install from it