Frank Middleton wrote:
Henry Hartley wrote:
I'm having trouble building what seems like a
fairly simple template.
I've read documentation, ...
From
http://meta.wikimedia.org/wiki/Help:ParserFunctions#Tables "Tables
Currently wiki pipe table syntax doesn't work inside conditionals, but there
are some workarounds," [workarounds listed there aren't particularly useful].
The first of the workarounds is to replace the pipe character | with a
template called Template:! which contains nothing but the pipe
character. I had done that. It turns out that IS particularly useful. In
fact, it's crucial to making tables in templates. Furthermore, instead
of {{!}}{{!}} to get a double pipe, it's better to create a template !!
that contains ||. Etc.
It turns out, however, that none of that was the problem. The thing is,
the #if: construct is part of an extension. It isn't defined by default.
So, you must download and install the ParseFunctions extension in the
/root/extensions directory. Then, you must "require" that extension in
the LocalSettings.php file. Once I did that, things started working MUCH
more the way I expected. So, for anyone having a problem with {{#if:
construct, if you find this thread, go to
http://meta.wikimedia.org/wiki/ParserFunctions#Installation and follow
the instructions there. Makes you life much easier.
I'm a little surprised these aren't included in the Standard MediaWiki
download. They seem pretty basic, but that's not really up to me to say.
No idea how Wikia gets it to work, but there are two
workarounds I can
recommend (used extensively on a genealogy site where both workarounds
are used (
http://www.middleton-stjohns.com) after much trial and error:
1) Use css instead of tables
(well, this isn't a workaround - it's the "right" way :-)
While I'm all for CSS when it comes to page layout, I'm not sure I agree
that CSS is the "right" way to make a table. This really IS a table.
2) Use Extension:Winter
(
http://www.mediawiki.org/wiki/Extension:Winter)
Winter conditionals look like this:
{{#if||expr||true path||false path|}}
and it handles the pipe table syntax very well.
As noted, the "standard" (but not Standard) ParserFunctions extension
is
enough, when coupled with ! type templates.
--
Henry