[Vim-l] Tip templates project

John Beckett johnb.beckett at gmail.com
Thu Oct 25 12:35:48 UTC 2007


Santhalus wrote:
> Does the Wikia use the mediawiki engine or it's own custom engine?
>...
> parameter for filtering the results ($wgExtraRandompageSQL)

The problem of 'Random page' sometimes picking missing pages is serious,
and deserves our attention.

I know nothing about the above questions. Bastl set up a wiki on his own
machine to experiment with the import. Maybe he could comment on the
likelihood of us being able to modify $wgExtraRandompageSQL. I gather
from Google that you would put an entry in LocalSettings.php (but is
there one of these exclusively for our wiki, and can we change it?).

Your suggestion about using a different namespace is intriguing and
ingenious, but I suspect it may need a fair bit of work to implement.

Here is the dilemma (tip 55 exists, tip 56 is missing):
- Tip 55 has a 'Next Tip' that is effectively [[VimTip56]].
- Tip 55 has no idea that tip 56 is missing.
- Therefore [[VimTip56]] has to be in the main namespace
  (because it might be a normal tip as far as tip 55 knows).
- That means Random Page can pick tip 56.

I could do something tricky with a script to have one kind of 'Next Tip'
redirect if redirecting to a normal tip, and another kind of 'Next Tip'
if redirecting to a missing/removed page (in another namespace). That
is, tip 55 _would_ have knowledge that 56 was missing.

Hmmm. If we put *all* VimTipNr pages in another namespace, then none of
them would be a target of Random Page. I'll have to ponder this, but it
seems like a brilliant manoeuvre. Thanks for finding the idea.

> Perhaps we would not even need Next/Prev tags in the template
> then, but instead go to nearest next/prev page in our namespace?
> How can the administrators control what's called on pressing
> Next/Prev? Is it possible to embed some custom php
> functions/sql queries there?

My guess is that custom functions/queries are totally impossible.
I imagine that wikia.com has no practical way of evaluating and
implementing code that people on its wikis might want to use.

The Next/Prev links are done entirely with wikitext. They use a
template, but that simply substitutes wikitext. So we just need to plan
how the wikitext should look, then work out how to reliably and simply
implement it.

For example, the following wikitext would create a link that displays as
"Next Tip". The target is a page in another namespace.

[[Vim Tips Wiki:Comment guidelines|Next Tip]]

I don't know what's involved in creating a namespace. I think you just
create a page with a colon in its name??

Currently we have pages like [[VimTip55]] in the main namespace.

Maybe we could instead have [[VimTip:55]] so the page title would be 55
in the namespace VimTip:.

In the body of a tip, you might want to create a link to tip 55. You
could put [[VimTip:55|The text you would like to display]].

Let's chew this over for a few days. It would be quite a dramatic
change, but quite readily achievable with scripts (I'm too battle
scarred to say "easy"). I think it would totally solve the problem
of Random Page picking missing tips.

John



More information about the Vim-l mailing list