Yuanji's Wiki

人間は考える葦である

用户工具

站点工具


侧边栏

本页面的其他翻译:
zh

Return Home

Contact

wiki:customize

这是本文档旧的修订版!


Customize DokuWiki

Note: all customs are based on the builtin default theme.

By default, there is no sidebar on the left like the official DokuWiki does, but we can add ours own very easily because it's nothing special but a regular sidebar page.

Multilingual

Another custom is to add multiple language support for wiki pages, which means I can write different language versions for every wiki page. To achieve that, just install the Translation Plugin.

After installing the plugin, configure it through the Config Manager. For example, set translation languages to zh ja.

To put the language selector above sidebar like the official DokuWiki does, we will have other extra work to do.

1. Create a file named sidebarheader.html, put it under $DOKU_ROOT/lib/tpl/dokuwiki/

sidebarheader.html
<?php
$translation = plugin_load('helper','translation');
if ($translation) echo $translation->showTranslations();
?>

2. Create a CSS file named userstyle.css, put it into $DOKU_ROOT/conf/

userstyle.css
.dokuwiki #dokuwiki__aside div.plugin_translation {
    float: none;
    text-align: center;
    border-bottom: 1px solid #ccc;
    padding-bottom: 1.4em;
    margin-bottom: 1.4em;
}
 
.dokuwiki #dokuwiki__aside div.plugin_translation select,.dokuwiki #dokuwiki__aside div.plugin_translation input {
    border: 1px solid #ccc;
    background-color: #fff;
}
wiki/customize.1573987316.txt.gz · 最后更改: 2019/11/17 19:41 JST 由 gimo