Not logged in. · Lost password · Register
Forum: General Help and Support Syntax and Usage RSS
Defining Interwiki links in farm-animal wiki site using subdomains
Avatar
teddydoors #1
Member for 2 weeks · 14 posts
Group memberships: Members
Show profile · Link to this post
Subject: Defining Interwiki links in farm-animal wiki site using subdomains
Links to one animal wiki site to another animal site are considered as "external links".

I would like to redefine them as interwiki links, or I would like to add my list of animal sites as Interwiki sites.

Any suggestion?
Avatar
pop #2
Member since Nov 2016 · 205 posts
Group memberships: Members
Show profile · Link to this post
Have you seen this: https://www.dokuwiki.org/Interwiki
Avatar
teddydoors #3
Member for 2 weeks · 14 posts
Group memberships: Members
Show profile · Link to this post
Thank you.

The disadvantage of this method is that you have to manually add all of your animals in the configure file. For wiki site with small number of animals, it is easy. But for a wiki site with dozens or even hundreds (yes, >100 is my initial plan) of animals, it does not work effectively.

You cannot remember all of those quick syntaxes, and more importantly, it is not handy for a normal visitor who comes to your wiki site and wants to edit a page.

I could be more nice if the system recognize wildcard subdomains, say, *.myfunkywikis.com as interwiki links.

Why do I want this feature? Because it is easier for a normal visitor to copy and paste links.

By the way, the real reason is that interwiki links are "dofollow", while external links are, by default, nofollow ones.
Avatar
teddydoors #4
Member for 2 weeks · 14 posts
Group memberships: Members
Show profile · Link to this post
Hello,

I realize that whether a link is classified as internal, external or interwiki depends on how the users anchor that link, (not the natural property of the link).

Even an internal link is determined as "external" if the users input the link by clicking on the popular WEB chain icon (which means external link function).

So, the only chance is to edit the Dokuwiki editor itself!

But the default Dokuwiki editor is not a plugin, so I don't know where to rework the source code. But even if I know, it's more likely that I will screw myself for hardcoding.

:(
Avatar
schplurtz (Moderator) #5
Member since Nov 2009 · 493 posts · Location: France, Finistère
Group memberships: Global Moderators, Members
Show profile · Link to this post
If I understand you well, users at your sites will use external link syntax to point to internal page ? Well if you can't educate your users, you can still write an action plugin that catches the IO_WIKIPAGE_WRITE event. In your handler, you have access to the page wiki text, and you have the possibility to change that text before it is written. See https://www.dokuwiki.org/devel:event:io_wikipage_write. A global search and replace could change external links that point to an internal page into a real internal link.


Now the second problem: make external links that match *.myfunkywikis.com internal links. I think you can write your own renderer plugin to extend the Doku_Renderer_xhtml class.

See the documentation on renderer.

In your class, I think you only have to redefine 2 functions : interwikilink and externallink.

In the function externallink(), if the link matches *.myfunkywikis.com, render it as an internal link. The same for interwikilink().


The plugin wizard will create the plugin structure for you. https://pluginwiz.dokuwiki.org/
Avatar
teddydoors #6
Member for 2 weeks · 14 posts
Group memberships: Members
Show profile · Link to this post
Thank you. You understand me correctly  :-D

I will try if things can be done easily with your hints.

Thanks.
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-11-12, 05:41:53 (UTC +01:00)