Other > Website Support

Wiki - toolbox and navbars

<< < (2/2)

Dominus Arbitrationis:
Okay, I moved a ton of pages (178 to be exact) over to the AI War namespace (I attached the list), and I am looking into easy ways to fix all the broken links. Until then, your best bet will be to try adding AI War: to the beginning of every link and seeing what happens (Use the show preview button!). So in other words, when you see [[EMP]], try changing that to [[AI War:EMP]] (That example will always work since I moved EMP to the namespace. :) ) I'm also about to let the bot have fun removing pages that are in the AI War namespace from the AI War category.

EDIT: I can't think of what the regex is to, on every even numbered line, delete all backslashes on that line. If someone can post that here, I can update all of the links really fast tomorrow. If not, oh well, I'll either remember it or do it the hard way and then remember it. :)

Good job! Also, just a note: [[AI War:EMP]] would display as "AI War:EMP", so we need to write [[AI War:EMP|EMP]] for it to display "EMP". Is there a way to either tell the wiki engine to not display the namespace if no "|thing" is provided or to use (yet another magic) regex?

I'm willing to help for the backslash regex and the "[[X:A|A]]" one, but I'm note sure... what prog do you use? Sed or something? Is there differences? I use Vim and I would remove backslashes with something like "%s:/\\//g". I'm a bit rusty with sed but maybe I can help.


--- Quote ---changed group membership for User:Dominus Arbitrationis from abuseeditor, bureaucrat, check user, patroller and administrator to abuseeditor, bureaucrat, check user, patroller, administrator and bot ?(Automated work again)
--- End quote ---


--- Quote from: Pumpkin on April 27, 2015, 04:51:15 AM ---Is there a way to either tell the wiki engine to not display the namespace if no "|thing" is provided?
--- End quote ---

Templates. :D

--- Code: ---//yes it needs to be one line like this, or you get an unwanted linebreak.
<includeonly>[[AI_War:{{#replace:{{{1}}}| |_}}|{{{1}}}]]</includeonly><noinclude>
--- End code ---

Then your usage would be {{AI_War|EMP}} where you name the template "AI_War" (and then have different templates for each namespace).

(Random thought... *Looks at the DF wiki*)

Ok, DF managed to get [[links]] to only link within a namespace, but I have no idea how.  It's not a template, so there might be some setting in the admin section.  I can't find anything via google, though.

Edit, scratch that.  There is a simple method.  Use a pipe.


The empty string after the pipe will be auto-parsed to strip the namespace. [[AI_War:EMP|EMP]]

Nice !
Thank you very much, Draco!


[0] Message Index

[*] Previous page

Go to full version