Minh Nguyen proposed:
> {{#ifeq:
[[{{NAMESPACE}}:{{lcfirst:{{PAGENAME}}}}]] |
> {{:{{NAMESPACE}}:{{lcfirst:{{PAGENAME}}}}}} | | Did you mean
> '''[[{{NAMESPACE}}:{{lcfirst:{{PAGENAME}}}}]]'''? }}
I replied:
Oh! Splendid! I didn't know about those.
I'll... try this out.
Thanks very much.
With a bit of tweaking (see below), this seems to work perfectly.
If you're curious, see
http://en.wiktionary.org/wiki/cypriot
http://en.wiktionary.org/wiki/Tamper
and
http://en.wiktionary.org/wiki/nowordatall
for a demonstration.
I had to remove the explicit {{NAMESPACE}}: tag. For whatever
reason, in the main namespace, that caused the comparison to
always be false, making the page always seem to exist, whether
it did nor not. But removing the tag makes it work perfectly
for the main namespace. (Removing the tag breaks it in the other
direction for the other namespaces, making the link almost always
fail, and the comparison always true, and the page therefore
never seeming to exist. But that's actually a good thing, in
this context, since we probably don't want to display "Did you
mean?" for minorly-different capitalizations in the various
project namespaces.)
At some point, once Tim recovers from (or becomes inured to) his
horror at sending us down this slippery slope in this hell-bent
handbasket, we can think about introducing a proper built-in
{{exists:}} operator, to eliminate the need for the bizarre
compare-the-substitution-to-the-redlink hack. (Though I *am*
appreciative of whoever devised it...)