DokuWiki

It's better when it's simple

User Tools

Site Tools


template:vector

vector for DokuWiki

Compatible with DokuWiki

  • 2014-09-29 "Hrun" yes
  • 2014-05-05 "Ponder Stibbons" unknown
  • 2013-12-08 "Binky" yes
  • 2013-05-10 "Weatherwax" yes

template Wikipedia/MediaWiki look and feel for DokuWiki (current)

Last updated on
2014-02-09
Repository
Source

:!: Problems with this template in Ponder Stibbons? Due to a bug in DokuWiki, you need to disable the 'compress' option! :!:

About

“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:

  • Discussions
    Configurable discussion pages without requiring an additional plugin.
  • User pages
    Users can have their own home page on your wiki.
  • Cite this Article
    Allows students, journalists, researchers, and the like to easily reference articles on your site.
  • Permanent Link
    Guarantees that articles you link to are the same as you saw them that second you link them.
  • Automatic plugin integration
    vector automatically detects and uses some popular, optionally installed plugins. Therefore you don't have to insert any code snippets or stuff when using: Translation,2) Open Office Export, dw2pdf, html2pdf
  • All non-page portions (e.g. navigation) of the template can be edited just as if they were pages. How cool is that? 8-)

Download

:!: 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
  • Note for existing users: Since 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.
Important release notes for 2014-02-09
  • :!: Fixed a major bug, the configuration option were un-savable on DokuWiki 2013-12-08 “Binky” (cf. Issue 22).
  • Full support for DokuWiki 2013-12-08 “Binky”.
  • There is no separate update archive anymore.
Important release notes for 2013-11-17
  • Full support for DokuWiki rc2013-10-28 “Binky”.

Repository (for developers)

The source code of this template is available as Git repository.

Verify download (for geeks)

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.

Installation

  1. Refer to template on how to install and use templates in DokuWiki. For updating, see below.
  2. Configure the place-holders. Have a look at “What are these "Please fill or disable this placeholder ([pagename])" everywhere?” to get help.

Support

If you need help:

If you found nothing helpful, ask your question at the DokuWiki forum (preferred) or IRC channel.

Contact

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.

Update

What to do to update your installed vector template?

  1. First of all: Backup your data, especially /lib/tpl/vector. But don't be scared. It is not rocket science.
  2. Download the current version from above.
  3. Simply uncompress and copy it over your current /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)
  4. Recommended: Also update the plugins Translation, Open Office Export, dw2pdf and html2pdf if you are using one ore more of them. :!: This is especially important regarding Translation (some older versions may cause problems and/or results are looking badly).
  5. Have fun and think about a small donation :-).
  6. Here is a list of files that were removed in recent releases. They do no harm, but you should delete them to keep your installation clean and tidy:
    #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

FAQ

What are these "Please fill or disable this placeholder ([pagename])" everywhere?

The template optionally imports normal wiki pages and shows their content as

  • navigation
  • toolbox
  • global, sitewide notice
  • copyright note (off by default, default is the common copyright note by DokuWiki)

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:

  • Show site wide notice?
  • If yes, use following wiki page for the site wide notice:
    […]
  • Show navigation?
  • If yes, use following wiki page as navigation:
    […]
  • Show copyright notice?
  • If yes, use default copyright notice?
  • If not default, use following wiki page as copyright notice:
    […]
  • Show toolbox?
  • If yes, use default toolbox?
  • If not default, use following wiki page as toolbox location:

How can I check which version is currently installed?

Simply have a look at /lib/tpl/vector/VERSION. This is a textfile containing the version you are using (e.g. 2010-06-12).

How can I create a custom toolbox or exportbox? How can I change the built-in boxes order?

:!: 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

  • with the default toolbox (or exportbox) and importing a normal wiki page is not flexible enough
  • and/or the order the built-in boxes are rendered

simply

  1. disable them via config
  2. copy the PHP code of the original boxes from /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:

  • Show navigation?
    […]
  • Show 'print/export' box?
    […]
  • Show toolbox?

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:

  • :!: You may want to remove the checks which disable some boxes. Especially watch out for:
    • if (tpl_getConf(“vector_exportbox”)){
    • if (tpl_getConf(“vector_toolbox”)){.
  • The DokuWiki function getID() returns the uncleanded ID of the current wiki page, including namespace.
  • The DokuWiki function 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()));
  • The DokuWiki function 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);
  • vector stores the username of the currently logged in user into the $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>";
    }

How to change the logo/favicon/tabs/boxes[...]?

Insert following to /vector/user/buttons.php

//delete all (defaults)
$_vector_btns = array();

How can I hide the edit tab and boxes until users are logged in?

Go to the DokuWiki admin section and have a look at the following option (introduced in vector version 2010-06-27):

  • Closed wiki (most links/tabs/boxes are hidden until user is logged in)?

Is the template compatible to the Discussion plugin?

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.

The insitu JS footnotes are displayed at the wrong position. Why don't you fix this?

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.

Browser compatibility

The template should be compatible with all modern browsers:

  • Firefox ≥ 3
  • Opera ≥ 10
  • Safari ≥ 4, Chrome ≥ 1 and other newer Webkit based browsers.
  • MS Internet Explorer ≥ 7

Please note:

  • MS Internet Explorer 6 is also supported in general, there are only some cosmetic issues at the admin menu. These issues do not affect normal wiki pages. The new Media Manager (introduced with DokuWiki 2011-11-10 “Angua RC1”) does not work with IE6.
  • I can't test every browser (version) out there. Therefore it does not mean the template does not work if your browser is not listed above. Just try it out if you want to be sure.

Customizing

Have a look at the README. Everything regarding

  • own logo
  • own favicon
  • own CSS
  • own JavaScript
  • own CSS, language specific
  • own Apple Touch Icon (apple-touch-icon.png)
  • own tabs
  • own buttons/icons (footer)
  • own boxes (left-column)

is described there.

For the ones who are never reading READMEs:

  • :!: The place for all user-defined, custom stuff is “vector/user”. Reason: this folder will not be touched on updates.
  • :!: If you want to replace the default logo showed in the upper left, simply create a /vector/user/logo.[png|gif|jpg]. The template recognizes the file automatically and will use it instead of the default logo.
  • :!: If you want to add own tabs, have a look at /vector/user/tabs.php (NOT /vector/conf/tabs.php).
  • :!: If you want to add own buttons (footer), have a look at /vector/user/buttons.php (NOT /vector/conf/buttons.php).
  • :!: If you want to add own boxes (left-column), have a look at /vector/user/boxes.php (NOT /vector/conf/boxes.php).

Custom tab examples

…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

//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

//(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"]; 
    }
}

Custom box examples

…to insert into /vector/user/boxes.php (NOT /vector/conf/boxes.php).6)

(un)subscribe page and NS in box

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

Hacks for /user/screen.css

…to insert into /vector/user/screen.css (NOT /vector/static/css/screen.css).7)

Wider sidebar / more space for left column

/* 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;
}

Trace: font, spacing, border color

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;
}

Table of Contents (TOC): indent if position = 'sidebar'

/* 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.

Table of Contents (TOC): font, spacing, corners, shadows

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;
}

Footer: centered

/* 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

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!

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;
}

Limit width of Ajax Quick Search results

#qsearch__out,
#qsearch__out ul {
  width: 17em;
  *width: 16em; /* do not remove the star in front, attribute hack for MS IE6/7 */
}

Add border to upload button of media manager

div.qq-upload-button {
 border: 1px solid __border__;
}

Version history

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

Latest changes

Sites using this Template

Feel free to add yours here:

English

German

French

Russian

Italian

Vietnamese

Esperanto

Multiple Languages

1) Wikipedia used “monobook” until the mid of 2010, now “vector” is in use.
2) via custom box, see /vector/user/boxes.php
3) except the example files with the .dist extension
4) , 5) , 6) , 7) cause files in vector/user/ will be preserved on updates, so you don't have to do your customizations over and over again
template/vector.txt · Last modified: 2015-04-18 00:34 by CR