====== DokuWiki setup ====== This page summarises specifics of [[https://www.dokuwiki.org/|DokuWiki]] setup and outlines development of [[https://www.dokuwiki.org/devel:templates|templates]] that are used for Workcraft website. ===== Template dokuwiki-light ===== The default ''dokuwiki-template'' has some elements that feel a bit heavy and redundant. We derived ''dokuwiki-light'' from the default ''dokuwiki'' template and simplified it as follows: - In ''inc/lang/en/lang.php'' shorten the following button text: \\ $lang['btn_recent'] = 'Changes'; $lang['btn_profile'] = 'Profile'; $lang['btn_media'] = 'Manager'; $lang['lastmod'] = 'Modified'; - Copy ''dokuwiki'' template into ''dokuwiki-light'' and go inside this new template directory. - Modify ''main.php'' * Tweak the title, so it is in the form //current:page:path - Workcraft//: \\ <?php tpl_pagetitle() ?> - <?php echo strip_tags($conf['title']) ?> * Make ''tpl_pageinfo()'' output and login details visible only to logged-in users; show copyright otherwise: \\
server->str('REMOTE_USER').' @ '; tpl_pageinfo(); } else { echo $conf['copyright']; } ?>
* Make the content of '''' section visible only to logged-in users: \\

...
- Modify ''tpl_header.php'' * Remove the following lines (this is to get rid of //skip to content// link on top of the mobile page view): \\ * Adjust parameters of ''tpl_link'' call: \\ tpl_link( wl(), '', 'accesskey="" title=""' ); * Remove the following code in ''%%%%'' section: \\ if (!empty($_SERVER['REMOTE_USER'])) { echo '
  • '; tpl_userinfo(); /* 'Logged in as ...' */ echo '
  • '; }
    * Alter ''%%%%'' section as follows: \\

    getDropdown($lang['tools']); } else { echo (new \dokuwiki\Menu\UserMenu())->getListItems('action '); } ?>
    - Modify ''css/design.less'': * Change paddings and margins of ''%%dokuwiki__header%%'':\\ #dokuwiki__header { padding: 0.5em 0.0em 0.5em; .headings { margin-top: 0.2em; margin-bottom: .2em; width: 59%; } .tools { margin-top: .2em; margin-bottom: .2em; width: 39%; } ... * Adjust margins and paddings of the search form: \\ form.search { display: block; position: relative; margin-top: 1.5em; margin-bottom: .0em; input { width: 20em; height: 2.4em; padding: .35em 22px .35em .35em; } ... * Hide elements of ''.pageID'' class: \\ .dokuwiki .pageId { display: none; ... * Align ''.docInfo'' to the left: \\ .dokuwiki .docInfo { font-size: 0.875em; text-align: left; } * Hide ''div.buttons'' in ''%%dokuwiki__footer%%'' section: \\ div.buttons a { display: none; ... - Modify ''css/mobile.less'': * Increase the width of search form:\\ #dokuwiki__sitetools form.search { float: left; margin: 0 .2em .2em 0; width: 77%; } * Decrease the width of mobile tools dropdown and login link:\\ #dokuwiki__header .mobileTools { display: block; font-size: 0.875em; margin: 0 0 .2em 0; float: right; width: 21%; } ===== Template dokuwiki-light-export ===== This template removes decoration elements that are redundant in the offline version of documents. Here is an instruction of how to produce ''dokuwiki-light-export'' template from ''dokuwiki-light'' template. - Copy ''dokuwiki-light'' template into ''dokuwiki-light-export'' and go inside this new template directory. - In ''main.php'': * Modify section''%%