Translations of this page?:

InterWiki Links

The original idea of InterWiki was to have one large distributed Wiki over the whole net. Today its more of an easy way to link from one wiki to another by having some simple link syntax to do so.

In DokuWiki this is done by prefixing Wiki pagenames with a shortcut separated by a > character.

Examples:

[[wp>Wiki]] links to Wikipedia,
[[Meatball>TourBusStop]] links to the MeatBall wiki TourBusStop,
[[google>Wiki]] links to a google search,
[[doku>wiki:interwiki]] links to this page.

Wiki links to Wikipedia, TourBusStop links to the MeatBall wiki TourBusStop, Wiki links to a google search. wiki:interwiki

There is one special interwiki shortcut called this. It always links to the webserver directory DokuWiki is installed in. You can use this to construct relative URLs. For example the following always links to the local XML feed: feed.php

[[this>feed.php]]

More Info on InterWiki:

Configuring InterWiki Shortcuts

InterWiki shortcuts are defined in the conf/interwiki.conf file. The default file contains all shortcuts suggested in http://usemod.com/intermap.txt. You can add your own interwiki links by creating a conf/interwiki.local.conf file and placing your links in that file.

It is possible to modify Dokuwiki’s conf/interwiki.conf file, however this could result in your changes being overwritten when upgrading Dokuwiki.

You can place imagefiles named after the shortcut in the lib/images/interwiki directory to use them instead of the default icon. They should have a size of 16×16 pixels and be in PNG or GIF format. You should also purge the cache if you have the default image instead of the one you uploaded.

rm -rf <path-to-dokuwiki>/data/cache/*

The format of the interwiki config file is:

<shortcut>      <url to wiki>

The shortcut is the one you will be able to use in the link later. In the URL you can use some placeholders to be more flexible in linking. If no placeholder is given the URL-encoded wikiname will be appended to the URL. These placeholders are available:

Placeholder Replaced by
{URL} URL-encoded wikiname
{NAME} wikiname without any encoding (the part which is appended to the url in interwiki.local.conf)
{SCHEME} scheme part if an URL was given as wikiname
{HOST} host part if an URL was given as wikiname
{PORT} port part if an URL was given as wikiname
{PATH} path part if an URL was given as wikiname
{QUERY} query part if an URL was given as wikiname

The last 5 parameters are useful when creating interwikilinks to cachesystems. Refer to the coral shortcut in the distributed interwiki.conf.

akismet-plugin-2006-10-20.tgz

Discussion

Hello, this is excellent feature!
I have question: where I can customize http-links in interwiki links?
I have trouble with my interwiki links.
For example:
I have 2 wiki:

and I want to use my interwikilinks from tech to user wiki.

I use modrewrite and .htaccess and usually my full links to article looks like http://mywikihost/user/faq/stupid_questions/ but when I use my interwiki this links looks like http://mywikihost/user%3Afaq%3Astupid_questions and in this case my web server sends 404 - not found.

How I can fix this problem?

Thank in advance

P.S. if i use keyword this in links - all Ok, but this is not interwiki links :-(

Bushroot 2007-09-08 09:17

@Bushroot

The way to solve that problem is to use the {NAME} placeholder in your interwiki.local.conf.
example     http://example.com/{NAME}

That way the URL you specify in

[[example>/go/to/here]]

will do what I think you're expecting.

http://example.com/go/to/here


2007-11-18 22:02 GMT-7

 
wiki/interwiki.txt · Last modified: 2007/12/12 14:35 by 88.66.62.170
 
Imprint Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki
WikiForumIRCBugsTranslate