If I have a simple table on a MediaWiki page like this:
{|{{#vardefine:new|style="background: none repeat scroll 0% 0% gold;"}}
|- {{#var:new}}
| hi
|}
and I press Rich Editor to switch to FCKeditor, the table code will change to:
{|
|-
| hi
|}
(So #vardefine and #var are removed!)
I have the VariablesExtension installed.
How can I prevent this? I’m posting it here (SO) because I assume this is a problem which can be fixed using different code on the page. Note that if the code is not in a table, there is no problem.
Note: if there are no variables in the table, there is also no problem:
{|style="background: none repeat scroll 0% 0% gold;"
|-
| no variable
|}
I found the solution but it is a bit of a monster. You need to create a template and use it in the table. In this example, the third (and final) parameter defines the colour of the cells (previously defined by a variable in the table – now that variable has been moved to the template).
The template will look like this:
The table will look like this: