[dokuwiki] Re: Interwiki links for local namespaces

  • From: Chris Smith <chris@xxxxxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Sat, 11 Feb 2006 15:16:49 +0000

The interwiki "this>"  should work for the current wiki.

If you are trying to use interwiki links, I suspect you will need multiple wiki installations or virtual installations.

wikiroot/en/doku.php
wikiroot/de/doku.php
wikiroot/fr/doku.php

A different approach may be to create a plugin for to handle your syntax {{langcode>page}} and have that plugin create a link to page which includes a language setting in the query string (e.g. doku.php?id=page&lang=fr) and have your template or a modified doku.php make adjustments to $conf['datadir'] based on its value - taking the default value from the $_SESSION setting.

e.g.

default dokuwiki,

$conf['datadir']  = $conf['savedir'].'pages';

for multi-lingual dokuwiki (not tested)

$_SESSION['lang'] = isset($_GET['lang']) ? cleanLang($_GET['lang']) : $_SESSION['lang'];
$conf['datadir'] = $conf['savedir'].$_SESSION['lang'].'/pages';


Cheers,

Chris

Guy Brand wrote:
  hi all,


I'm trying to define interwiki "tags" for language namespaces. I have first tried:

    de        de/
    fr        fr/

  which is perfect except when on the german page you write "french
  version is at [[fr>page]] which points finally to id=/de/fr/page
  Relative links... turned to absolute by using:

    de        /de/
    fr        /fr/

  doesn't work because the right part is now an absolute link in the
  local webserver (so generally outside the wiki).

  Reading inc/parser/xhtml.php I saw there is no placeholder for
  interwiki which corresponds to dokuwiki itself. So I have added

$url = str_replace('{BASE}',DOKU_BASE,$url);
to have {BASE} in interwiki.conf expanded to DOKU_BASE url. Thus I
tried:


    de        {BASE}/de/{NAME}
    fr        {BASE}/fr/{NAME}

  but this fails also, urls are

    http://myserver/~bug/dokuwiki//de/page
    http://myserver/~bug/dokuwiki//fr/page

  which only works if rewrites are on. So I also tried:

    de        {BASE}doku.php?id=/de/{NAME}
    fr        {BASE}doku.php?id=/fr/{NAME}

but this ends up with the same links as above (I don't really
understand why).


  Any suggestion on how I could achieve absolute working urls inside
  dokuwiki using interwiki links? This would help for the multilingual
  work in progress.

  Cheers,


-- DokuWiki mailing list - more info at http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: