Wikipedia/MediaWiki look and feel for DokuWiki (current)
Compatible with DokuWiki
“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:
With that said, there's always room for improvement. If you're able to add any contributions to make vector for DokuWiki better, please let me know or discuss your thoughts.
If you like the template, think about a donation. It is a lot of work.
| Version | 2011-12-10 |
|---|---|
| Download | 2011-12-10_vector.tar.gz |
| From | Any version |
|---|---|
| To | 2011-12-10 |
| Download | 2011-12-10_vector-update.tar.gz |
/vector/user/boxes.php: just replace the old with the new lines.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 my GnuPG/PGP key (0x423B2839). You can use gpg --verify ./CHECKSUMS.asc to check/validate it.
Some screenshots can be found here.
The template should be compatible with all modern browsers:
Please note:
What to do to update your installed vector template?
/lib/tpl/vector. But don't be scared. It is no rocket science./lib/tpl/vector. This works without problems when you followed the rules described in the README (⇒ the place for *all* user-defined, custom stuff is /lib/tpl/vector/user!) cause previously existing files in this directory are simply not included in the update archive (and therefore it can't overwrite anything of your stuff).#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
Feel free to add yours here:
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).3)
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"]; } }
…to insert into /vector/user/boxes.php (NOT /vector/conf/boxes.php).4)
//QR-Code of the current page (powered by <http://QR-Server.com/api/>) $_vector_boxes["qrcode"]["headline"] = "QR-Code"; $_vector_boxes["qrcode"]["xhtml"] = '<img src="http://api.qrserver.com/v1/create-qr-code/?data='.urlencode(wl(cleanID(getId()), false, true, "&")).'&size=135x135" style="margin:0.5em 0 0.3em -0.2em;" alt="QR-Code: '.wl(cleanID(getId()), false, true).'" title="QR-Code: '.wl(cleanID(getId()), false, true).'" /><p style="font-size:6px !important;margin:0;padding:0;color:#aaa;"><a href="http://goqr.me/" style="color:#aaa;">QR Code</a> by <a href="http://qrserver.com/" style="color:#aaa;">QR-Server</a></p>';
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
…to insert into /vector/user/screen.css (NOT /vector/static/css/screen.css).5)
/* Give sidebar more space. Default: 10em. */ div#content, div#head-base, div#footer { margin-left: 12em; } div#panel { 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 Lennylenehey
for this!
The template optionally imports normal wiki pages and shows their content as
This means you can create the page mentioned in the “Please fill 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.6)
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 uncleanded 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 max 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.
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.
Please refer to the discussion page.
For a complete change log, see the commits on Github. Older releases are no longer recommended for usage and are listed for reference only.
| vector version | Download | Designed for and tested on DokuWiki | Comment |
|---|---|---|---|
2011-12-10 | Release Update | rc2011-11-10 “Angua RC1”, 2011-05-25a “Rincewind” | 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” | /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 |