Not logged in. · Lost password · Register
Forum: General Help and Support Syntax and Usage RSS
Internal link point to page regardless of namespace?
Avatar
cb #1
Member for a month · 5 posts
Group memberships: Members
Show profile · Link to this post
Subject: Internal link point to page regardless of namespace?
Hi all! New to Dokuwiki, I’ve been using Gollum and markdown files but thinks dokuwiki might work better for me (mostly due to speed and more bells and whistles). However, there is one behavior I’m having trouble with.

In Gollum (and mediawiki, I’m pretty sure) you can link to a page from anywhere (any  namespace) without having to type out the whole path. In dokuwiki it seems this is impossible unless the page you want to link to is at the root level.

For instance, let’s say i have a namespace called “recipes” and within that, a page called “salsa”. Let’s say I have another namespace called “appliances” and within that, a page called “blender”

When I compose the “salsa” page, I’d like to be able to say something like “to blend the salsa, use the [[blender]]”. But if I do that, the link points to a page in the “recipes” namespace called “blender.” I know I can link to the right page by doing “[[appliances:blender]]” but I find this vexing. I want [[blender]] in the “salsa” page to point to the page “blender” no matter what namespace it’s in.

I have about 1400 pages written in markdown that I imported into dokuwiki, and they all link to page names (no namespace:page links). Is there any way i can make dokuwiki work like Gollum and mediawiki when it comes to linking?

I’ve been searching through the forums but haven’t found an answer- if this has already been answered, Sorry in advance! Thanks for your help!
Avatar
LarsDW223 #2
Member since Sep 2014 · 377 posts · Location: Paderborn
Group memberships: Members
Show profile · Link to this post
Hello cb,

yes, what you want does not seem to be possible with the standard behaviour, please see https://www.dokuwiki.org/namespaces. But maybe the autolink4 plugin (or other plugins) can help you. See https://www.dokuwiki.org/plugin:autolink4.
Avatar
cb #3
Member for a month · 5 posts
Group memberships: Members
Show profile · Link to this post
Thanks for your reply! It does seem strange that this isn’t possible... is it because of the flat file nature of dokuwiki? It seems that every other wiki software allows this sort of linking.

I’ll check out that “auto link” plugin. Thanks!
Avatar
LarsDW223 #4
Member since Sep 2014 · 377 posts · Location: Paderborn
Group memberships: Members
Show profile · Link to this post
Thanks for your reply! It does seem strange that this isn’t possible... is it because of the flat file nature of dokuwiki? It seems that every other wiki software allows this sort of linking.

Well I did not write DokuWiki but I assume it might be the reason. If an internal link can point to a pgae with that name in any namespace it would mean you have to search through every namespace. Ok, that could be handled by some kind of directory dictionary or indexer. But the result can be ambiguous. What if there are two pages with the same name in different namespaces? Which one is chosen?
Avatar
cb #5
Member for a month · 5 posts
Group memberships: Members
Show profile · Link to this post
Good point - as I understand it, this is why Gollum demands unique names for each page. I’m not sure how mediawiki handles it.

I’ll give it a shot using dokuwiki the way it works, maybe there are advantages to working this way that I haven’t realized.
Avatar
cb #6
Member for a month · 5 posts
Group memberships: Members
Show profile · Link to this post
Or maybe I’ll just remove my directory structure entirely, put every single page in one directory, and use another method to organize things (like tags)
Avatar
LarsDW223 #7
Member since Sep 2014 · 377 posts · Location: Paderborn
Group memberships: Members
Show profile · Link to this post
Ok, but give the autolink4 plugin a try. Maybe it's just doing what you want.
Avatar
cb #8
Member for a month · 5 posts
Group memberships: Members
Show profile · Link to this post
Thanks! I’ve been reading the docs but I haven’t quite figured out how to configure it to do what I want. I’ll keep experimenting
Avatar
MartinR #9
Member since Jul 2015 · 120 posts · Location: UK
Group memberships: Members
Show profile · Link to this post
In reply to post #7
I've never run Gollum, so will ignore that.

In Wikipedia (which of course is based on Mediawiki) you can link to a page from anywhere, but you do need to specify the namespace if you change namespaces.  For instance within the English wikipedia:

[[convert]] -> a redirect to https://en.wikipedia.org/wiki/Conversion
[[template:code]] -> https://en.wikipedia.org/wiki/Template:Code
[[fr:convert]] -> https://fr.wikipedia.org/wiki/Convert

Dokuwiki is similar, except that instead of a number of flat namespaces (such as Mediawiki), there is a hierarchy of namespaces.

Because of its hierarchical nature you have a number of option for linking between namespaces.  Put simply (see the link Lars gave you for details) you need to navigate to the "other" namespaces.  You can either specify it exactly [[:appliances:blender]] or relatively by going "up a level" and then coming down [[..:appliances:blender]].

Consider the point of a namespace, it is to isolate a set of names and allow duplication.  You might want recipies:hotpot for the dish from Lancashire and appliances:hotpot for the cooking utensil.  Namespaces allow you to do this natively, otherwise you need to name your pages recipies-hotpot and appliances-hotpot which is probably worse that using the namespace.

You can install a redirection plugin such as the pageredirect plugin that allows you to have pages which silently jump to the appropriate page.  In your case having a page recipes:blender which was a redirect to appliances:blender means that you only ever need to link to blender and will be magically transferred.

HTH
Avatar
Samana Johann #10
Member since Jun 2018 · 133 posts · Location: Aural/Cambodia
Group memberships: Members
Show profile · Link to this post
Since multilingual, different namespace rather then different domain, might be one main reason. The other, if structured, might be because having same pagenames more often, "index.txt" for example.

Doing a flat structur is possible the easierst way with such a wish.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2019-02-16, 17:20:32 (UTC +01:00)