Wikipedia/MediaWiki look and feel for DokuWiki
Compatible with DokuWiki
Problems with this template in Ponder Stibbons? Due to a bug in DokuWiki, you need to disable the 'compress' option!
“vector for DokuWiki” brings you the current1) Wikipedia/MediaWiki look and feel for DokuWiki.
There are some things you'll find in this template that you won't find in most other DokuWiki templates, and are inspired by Wikipedia and MediaWiki. Some features:
If you like the template, you might want to donate a few bucks, or get some cool QR Code generator merchandise. It is a lot of work. Thank you!
Version | 2014-02-09 |
---|---|
Download | 2014-02-09_vector.tar.gz |
2014-02-09
, there is no separate update .tar.gz
anymore. The current archive is used for both install and update now. Instead of providing a separate update archive without the /user
sub-directory, all example files in /user
are delivered with the .dist
extensions now to make sure your files won't get overwritten. This should be easier an more DokuWiki-like than the previous approach.The source code of this template is available as Git repository.
See CHECKSUMS.asc
for MD5, SHA-1 and SHA-256 checksums. The file is signed with the GnuPG/PGP key (0x423B2839
). You can use gpg --verify ./CHECKSUMS.asc
to check/validate it.
If you need help:
If you found nothing helpful, ask your question at the DokuWiki forum (preferred) or IRC channel.
If you think you have found a bug or have a useful idea (a.k.a. “feature request”), create an issue on GitHub (preferred), or contact us by mail.
Feel free to submit patches as GitHub pull requests (preferred) or by mail as well. However, please try to respect the DokuWiki coding style as this template follows its rules.
What to do to update your installed vector template?
/lib/tpl/vector
. But don't be scared. It is not rocket science./lib/tpl/vector
. This works without problems when you follow the rules described in the README (⇒ the place for *all* user-defined, custom stuff is /lib/tpl/vector/user
!) because previously existing files in /lib/tpl/vector/user
will not be touched or overwritten.3)#removed in 2014-02-09 /static/img/button-qrcode.png /user/button-css.png /user/button-xhtml.png /bug49642.php /README-de #removed in 2011-11-29 /static/3rd/dokuwiki/_mediamanager.css /static/3rd/dokuwiki/basic.css /static/3rd/dokuwiki/content.css /static/3rd/dokuwiki/design.css /static/3rd/dokuwiki/includes.css /static/3rd/dokuwiki/structure.css /inc_mediamanager.php #removed in 2011-03-17 /static/3rd/dokuwiki/_linkwiz.css /static/3rd/dokuwiki/layout.css /static/3rd/dokuwiki/media.css
The template optionally imports normal wiki pages and shows their content as
This means you can create the page mentioned in the “Please fill or disable this placeholder” message (e.g. “:wiki:navigation”) and its content will be shown instead of the message. All of these placeholders are configurable. Have a look at the DokuWiki admin section:
Simply have a look at /lib/tpl/vector/VERSION
. This is a textfile containing the version you are using (e.g. 2010-06-12
).
First of all, remember: make changes to /vector/user/boxes.php
ONLY. Do NOT edit /vector/conf/boxes.php
to prevent trouble on updates.4)
If you are not happy
simply
/vector/conf/boxes.php
into /vector/user/boxes.php
and do all your customization there.To do so, go to the DokuWiki admin section and have a look at the following options to disable the boxes you do not like:
Now copy the code of the box you want to customize from /vector/conf/boxes.php
into /vector/user/boxes.php
and start editing them as you like. Useful coding hints:
if (tpl_getConf(“vector_exportbox”)){
if (tpl_getConf(“vector_toolbox”)){
.getID()
returns the uncleaned ID of the current wiki page, including namespace.getNS()
returns the namespace-part of an absolute wiki page ID. To get the cleaned namespace of the current wiki page, you may use: echo getNS(cleanID(getID()));
cleanID()
cleans up wiki page IDs, making them ready for usage with wl()
and auth_quickaclcheck()
.wl()
returns you the relative or absolute URL of a wiki page. Example: get the URL of the current wiki page: //relative URL echo wl(cleanID(getID())); //absolute URL echo wl(cleanID(getID()), "", true);
$loginname
variable. You can use it to check if a user is logged in: if ($loginname === ""){ //client is not a logged in user $_vector_boxes["example-not-logged-in"]["headline"] = "Box: not logged in" $_vector_boxes["example-not-logged-in"]["xhtml"] = " <ul>\n" ." <li id=\"t-login\"><a href=\"".wl(cleanID(getId()), array("do" => "login"))."\" rel=\"nofollow\">".hsc($lang["btn_login"])."</a></li>\n" //language comes from DokuWiki core ." </ul>"; }else{ //client is an authenticated user $_vector_boxes["example-logged-in"]["headline"] = "Box: Hi ".hsc($loginname)."!"; $_vector_boxes["example-logged-in"]["xhtml"] = " <ul>\n" ." <li id=\"t-upload\"><a href=\"".DOKU_BASE."lib/exe/mediamanager.php?ns=".getNS(getID())."\" rel=\"nofollow\">".hsc($lang["vector_toolbxdef_upload"])."</a></li>\n" ." </ul>"; }
See customizing.
Insert following to /vector/user/buttons.php
//delete all (defaults) $_vector_btns = array();
Go to the DokuWiki admin section and have a look at the following option (introduced in vector version 2010-06-27
):
Short answer: yes.
The template brings support for basic discussion pages without the need to install any additional plugin. However, if you are interested to use the Discussion plugin (which allows threaded replies, avatars, captcha and other controls at the bottom of the wikipage instead of a separated basic discussionpage), simply install it and deactivate the template option “Use discussion tabs/sites?” at the DokuWiki admin section.
Even if the footnotes may work as expected in some other templates, the wrong insitu footnote popup position is not a template but a DokuWiki 2010-11-07 “Anteater” issue (see Bug 2114). All templates with relative positioning are affected. This bug is fixed since DokuWiki 2011-04-22 “Rincewind RC1”. If you update your DokuWiki installation, the problem should be gone.
The template should be compatible with all modern browsers:
Please note:
Have a look at the README. Everything regarding
apple-touch-icon.png
)is described there.
For the ones who are never reading READMEs:
/vector/user/logo.[png|gif|jpg]
. The template recognizes the file automatically and will use it instead of the default logo./vector/user/tabs.php
(NOT /vector/conf/tabs.php
)./vector/user/buttons.php
(NOT /vector/conf/buttons.php
)./vector/user/boxes.php
(NOT /vector/conf/boxes.php
).
…to insert into /vector/user/tabs.php
(NOT /vector/conf/tabs.php
).5)
Hint: Replace $_vector_tabs_right
with $_vector_tabs_left
to add the tabs to the left instead the right tab navigation (and vice versa).
//recent changes if (!empty($conf["recent_days"])){ $_vector_tabs_right["ca-recent"]["text"] = $lang["btn_recent"]; //language comes from DokuWiki core $_vector_tabs_right["ca-recent"]["href"] = wl("", array("do" => "recent"), false, "&"); $_vector_tabs_right["ca-recent"]["nofollow"] = true; }
//(un)subscribe namespace tab if (!empty($conf["useacl"]) && !empty($conf["subscribers"]) && !empty($loginname)){ //$loginname was defined within main.php if (empty($INFO["subscribedns"])){ //$INFO comes from DokuWiki core $_vector_tabs_right["ca-watchns"]["href"] = wl(cleanID(getID()), array("do" => "subscribens"), false, "&"); $_vector_tabs_right["ca-watchns"]["text"] = $lang["vector_subscribens"]; }else{ $_vector_tabs_right["ca-watchns"]["href"] = wl(cleanID(getID()), array("do" => "unsubscribens"), false, "&"); $_vector_tabs_right["ca-watchns"]["text"] = $lang["vector_unsubscribens"]; } }
The vector template doesn't handle MENU_ITEMS_ASSEMBLY event, so plugins that relies on this event to add buttons to menus (like deletepagebutton and bookcreator plugins) doesn't show up it's icon/link (button). But you can foreach each PageMenu item and add it's icon/link manually.
//custom plugin tab $skip_types = ['backlink', 'create', 'edit', 'export_odt', 'export_pdf', 'revs', 'show', 'top']; foreach((new \dokuwiki\Menu\PageMenu())->getItems() as $item) { if(in_array($item->getType(), $skip_types)) { continue; } $attr = $item->getLinkAttributes(); $_vector_tabs_right["tab-" . $item->getType()]["text"] = $attr['title']; $_vector_tabs_right["tab-" . $item->getType()]["href"] = $attr['href']; $_vector_tabs_right["tab-" . $item->getType()]["class"] = $attr['class']; if ($item->isNofollow()) { $_vector_tabs_right["tab-" . $item->getType()]["nofollow"] = true; } }
…to insert into /vector/user/boxes.php
(NOT /vector/conf/boxes.php
).6)
I altered things a bit for those that want the (un)subscribe tab in a button (limited space in the upper navigation)
//ATTENTION: "ca-watch" is used as css id selector! if (!empty($conf["useacl"]) && !empty($conf["subscribers"]) && !empty($loginname)){ //$loginname was defined within main.php $_vector_boxes["ca-watch"]["headline"] = $lang["vector_subscribtions"]; if (empty($INFO["subscribed"])){ //$INFO comes from DokuWiki core $_vector_boxes["ca-watch"]["xhtml"] .="<ul>\n" ." <li id=\"t-subpage\"><a href=\"".wl(cleanID(getID()), array("do" => "subscribe"), false, "&")."\" rel=\"nofollow\">".hsc($lang["btn_subscribe"])."</a></li>\n" ." </ul>"; }else{ $_vector_boxes["ca-watch"]["xhtml"] .="<ul>\n" ." <li id=\"t-subpage\"><a href=\"".wl(cleanID(getID()), array("do" => "unsubscribe"), false, "&")."\" rel=\"nofollow\">".hsc($lang["btn_unsubscribe"])."</a></li>\n" ." </ul>"; } if (empty($INFO["subscribedns"])){ //$INFO comes from DokuWiki core $_vector_boxes["ca-watch"]["xhtml"] .="<ul>\n" ." <li id=\"t-subns\"><a href=\"".wl(cleanID(getID()), array("do" => "subscribens"), false, "&")."\" rel=\"nofollow\">".hsc($lang["vector_subscribens"])."</a></li>\n" ." </ul>"; }else{ $_vector_boxes["ca-watch"]["xhtml"] .="<ul>\n" ." <li id=\"t-subns\"><a href=\"".wl(cleanID(getID()), array("do" => "unsubscribens"), false, "&")."\" rel=\"nofollow\">".hsc($lang["vector_unsubscribens"])."</a></li>\n" ." </ul>"; } }
Note that I added $lang[“vector_subscribtions”] to the lang.php file (the title of the box), feel free to enter a name there (Inschrijvingen, Subcribtions, or something)
In my case I added the following to <wiki>\lang\nl\lang.php
$lang["vector_subscribtions"] = "Inschrijven";
If nothing is entered there, no title is shown (only the line).
If you want to remove the (un)subscribe tabs from the upper navigation, I suggest commenting them in the conf/tabs.php or the user/tabs.php, don't remove things you might need later on
Grtz, Theo
The vector template doesn't handle MENU_ITEMS_ASSEMBLY event, so plugins that relies on this event to add buttons to menus (like deletepagebutton and bookcreator plugins) doesn't show up it's icon/link (button). But you can foreach each PageMenu item and add it's icon/link manually. See Issue #64 on GitHub (arsava/dokuwiki-template-vector).
…to insert into /vector/user/screen.css
(NOT /vector/static/css/screen.css
).7)
/* Give sidebar more space. Default: 10em. */ div#content, div#head-base, div#footer { margin-left: 12em; } div#panel, div#p-logo, div#p-logo a { width: 12em; } #left-navigation { left: 12em; }
Simply replace the 12em
with a value you like. Default value is 10em
.
div#p-navigation li.level1 ul { margin-top: 0.5em !important; margin-left: 1em !important; }
Smaller font, space out breadcrumbs, dimmer text, lighter border
.catlinks { font-size: 75%; border: 1px solid #ddd; } .bchead, a.breadcrumbs { opacity: 0.6; } a.breadcrumbs { margin: 0 2px; } a.breadcrumbs:hover { opacity: 1; }
/* Indent table of contents (TOC) (if position: sidebar) Note: Config option "Table of contents (TOC) position" (vector_toc_position) has to be set to "sidebar". Otherwise, this does not have any effect) */ div#panel #p-toc .dokuwiki li.level2 { margin-top: 0.5em; margin-left: 4px; } div#panel #p-toc .dokuwiki li.level3 { margin-top: 0.5em; margin-left: 7px; } div#panel #p-toc .dokuwiki li.level4, div#panel #p-toc .dokuwiki li.level5, div#panel #p-toc .dokuwiki li.level6 { margin-top: 0.5em; margin-left: 10px; }
If you need more/less indentation, adjust the margin-left
values to you needs.
Larger font, lighter color for TOC header text, slight gradient for TOC header, more space after bullets, rounded corners + shadows.
div.dokuwiki div.toc { font-size: 90%; } div.dokuwiki .toc a { padding-left: 0.3em; } div.dokuwiki div.tocheader { padding-left: 1em; color: #333; } .tocheader { border-top-left-radius: 8px; border-top-right-radius: 8px; -moz-border-radius-topleft: 8px; -moz-border-radius-topright: 8px; box-shadow: 4px 4px 10px #aaa; -moz-box-shadow: 4px 4px 10px #aaa; background: -webkit-linear-gradient(left, #eaf2f8, #dee7ec); background: -moz-linear-gradient(left, #eaf2f8, #dee7ec); background: -ms-linear-gradient(left, #eaf2f8, #dee7ec); } #toc__inside { border-bottom-left-radius: 8px; border-bottom-right-radius: 8px; -moz-border-radius-bottomleft: 8px; -moz-border-radius-bottomright: 8px; box-shadow: 4px 4px 10px #aaa; -moz-box-shadow: 4px 4px 10px #aaa; }
/* centered footer (instead of left aligned) */ #footer #footer-info li, #footer #footer-info .dokuwiki, #footer #footer-info .license, #footer #footer-places li, #footer #footer-places .dokuwiki { text-align: center !important; } #footer #footer-places li { float: none !important; }
I prefer the default template way that the footer buttons highlight when you put you mouse on them (or rather, how they are faded when you do not have your mouse on them), like they do at the bottom of this page, so I added this to /vector/user/screen.css
:
/* highlight footer buttons on hover */ #footer #footer-places a img { opacity: 0.5; border: 0; } #footer #footer-places a:hover img { opacity: 1; }
highlight current section (# in URL)
:target { background-color: lightblue; }
Most other templates are displaying InterWiki icons on the left side of links (vector does this on the right side by default). CSS to change the behaviour (left instead of right side):
div.dokuwiki a.interwiki { background-position: center left; padding: 0 0 0 17px; }
Thanks to Lenny for this!
div#bodyContent a.mail, div#bodyContent a.urlextern { background-position: center left; padding: 0 0 0 13px; } div.dokuwiki a.windows { background-position: center left; padding: 0 0 1px 18px; }
#qsearch__out, #qsearch__out ul { width: 17em; *width: 16em; /* do not remove the star in front, attribute hack for MS IE6/7 */ }
div.qq-upload-button { border: 1px solid __border__; }
/* Automatically numbering Headings via CSS https://philarcher.org/diary/2013/headingnumbers/ */ body {counter-reset: h2} h2 {counter-reset: h3} h3 {counter-reset: h4} h4 {counter-reset: h5} h5 {counter-reset: h6} h2:before {counter-increment: h2; content: counter(h2) ". "} h3:before {counter-increment: h3; content: counter(h2) "." counter(h3) ". "} h4:before {counter-increment: h4; content: counter(h2) "." counter(h3) "." counter(h4) ". "} h5:before {counter-increment: h5; content: counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) ". "} h6:before {counter-increment: h6; content: counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) "." counter(h6) ". "} h2.nocount:before, h3.nocount:before, h4.nocount:before, h5.nocount:before, h6.nocount:before, #dw__toc h3:before, #panel h5:before { content: ""; counter-increment: none } /* Automatically numbering Table of Contents (TOC) via CSS https://www.freecodecamp.org/news/numbering-with-css-counters/ */ #dw__toc ul ul { list-style-type: none; counter-reset: css-counters 0; /* intializes counter, set -1 for zero-based counters */ } #dw__toc ul ul li div.li:before { counter-increment: css-counters; content: counters(css-counters, ".") " "; /* generates inherited counters from parents */ }
By default, images are not scaled to the width of the page body and exceed the visible region of the page, so I added this to /vector/user/screen.css
:
div#bodyContent.dokuwiki img { max-width: 100%; height: auto; object-fit: cover; } div#bodyContent.dokuwiki svg { max-width: 50%; height: auto !important; object-fit: cover; }
Older releases are no longer recommended for usage and are listed for reference only.
vector version | Download | Designed for and tested on DokuWiki | Release notes and comments |
---|---|---|---|
2014-02-09 | Release No update archive anymore, the new tar.gz is used for both install and update. | 2013-12-08 “Binky”, 2012-10-13 “Adora Belle” | Fixed bug, un-savable configuration on 2013-12-08 “Binky”; Full support for DokuWiki 2013-12-08 “Binky”; Add Hebrew language file; Update support and contact information. |
2013-11-17 | Release Update | rc2013-10-28 “Binky”, 2012-10-13 “Adora Belle” | Full support for DokuWiki rc2013-10-28 “Binky”; Add Korean language files; Update support and contact information. |
2013-02-19 | Release Update | 2012-10-13 “Adora Belle”, 2012-01-25b “Angua” | Small print styles improvement; Update support and contact information. |
2012-10-17 | Release Update | 2012-10-13 “Adora Belle”, 2012-01-25b “Angua” | Small improvements: better SSL/HTTPS handling for the QR Code feature; Catalan language update. |
2012-10-14 | Release Update | 2012-10-13 “Adora Belle”, 2012-01-25b “Angua” | Full support for DokuWiki 2012-10-13 “Adora Belle”; New option: vector_qrcodebox (controls if a box with a QR Code of current wiki page URL will be shown in the sidebar); Multilingual side-wide and copyright notices for Translation plugin users (cf. commit message); Added Slovak and Persion language, French language update. |
2011-12-10 | Release Update | rc2011-11-10 “Angua RC1”, 2011-05-25a “Rincewind” | This version introduces a multilingual navigation for Translation plugin users. Users of the existing translation box snippet should edit some source code in /vector/user/boxes.php : just replace the old with the new lines.Added fix for wrong horizontal rule clearing ( ---- / <hr> -Tag); Catalan language update. |
2011-11-29 | Release Update | rc2011-11-10 “Angua RC1”, 2011-05-25a “Rincewind” | Full support for DokuWiki's new Media Manager; Multilingual navigation for Translation plugin users (NOTE: Users of the existing translation box snippet should edit some source code in /vector/user/boxes.php : just replace the old with the new lines); Apple Touch Icon support (see README for details); added Russian, Spanish and Catalan language. |
2011-05-10 | Release Update | rc2011-05-08 “Rincewind RC2”, 2010-11-07 “Anteater”, 2009-12-25 “Lemming” | Cross browser compatibility fixes. |
2011-05-04 | Release Update | rc2011-04-22 “Rincewind RC1”, 2010-11-07 “Anteater”, 2009-12-25 “Lemming” | Improved media manager, added Basque language, hide breadcrumbs in mediamanager. |
2011-03-17 | Release Update | 2010-11-07 “Anteater”, 2009-12-25 “Lemming” | Added French language, plugin compatibility improvements (CSS): bureaucracy and some others. Switched css base from 'default' template to 'starter' template (→ reason). |
2010-08-17 | Release Update | 2009-12-25 “Lemming” | Added Chinese (simplified) language files; Respect disabled 'search' and 'profile'; Added /user/tracker.php to make web analytics software integration easier; CSS: fixed list styles, TOC, some minor bugs; |
2010-06-29 | Release Update | 2009-12-25 “Lemming” | Template respects $conf['disableactions'], improved mediamanager. |
2010-06-27 | Release Update | 2009-12-25 “Lemming” | New config options (user pages optional, closed wiki - most tabs/boxes will be hidden until user is logged in if active); added Italian, Brazilian Portuguese and Dutch language; support for PNG favicon. |
2010-06-12 | Release | 2009-12-25 “Lemming” | Initial release |
For a complete change log, see the commits on Github.
Feel free to add yours here:
/vector/user/boxes.php
.dist
extension