Henry Hartley wrote:
Sorry for the longish question but I wanted to give as much detail as possible.
MediaWiki 1.11.1 CentOS 5.1 MySQL 5.0.22-2.2.el5 PHP 5.1.6.15.el5
I'm having trouble building what seems like a fairly simple template. I've read documentation, I've looked at examples, I've even copied templates from other sites but it's not working. Any help you can provide would be greatly appreciated. I have simplified my template to isolate the problem. So, I have a template called Person-Simple that looks like this:
<includeonly>{| class="infobox" border="1" |- ! align="center" colspan="2" border="1" |'''{{{Name}}}''' |- {{#if:
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].
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 :-)
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.
There is a third workaround (use HTML table syntax) but that isn't a great solution...
HTH -- Frank Middleton
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:
- 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.
- 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.
mediawiki-l@lists.wikimedia.org