[Mediawiki-l] conditional statement in version 1.5.8 ??? (fixed example links)

Erik Mermagen mermagen at earthlink.net
Sun Apr 9 04:21:18 UTC 2006



Begin forwarded message:

From: Erik Mermagen <mermagen at earthlink.net>
Date: April 8, 2006 11:23:00 PM EDT
To: mediawiki-l at Wikimedia.org
Subject: [Mediawiki-l] conditional statement in version 1.5.8 ??? 
(Template:Qif won't work)
Reply-To: MediaWiki announcements and site admin list 
<mediawiki-l at Wikimedia.org>

Does anyone here know how to create a conditional statement in version
1.5.8 that I could use in a template?

if the stated variable is not defined
WHAT I WANT IS TO HAVE A TABLE ROW NOT APPEAR IF A STATED VARIABLE IS
NOT DEFINED.

For EXAMPLE:

"if" {{{lubrication}}} !null (is something) "then"
        <TR>
          <td><strong>[[Lubrication]]:</strong></TD>
          <TD>{{{lubrication}}}</TD>
        </TR>
"else" don't show the table row at all. Leave that alone and continue
to the next conditional statement.

Another EXAMPLE would be On this page:
http://wikimoto.org/wikimoto/index.php?title=Honda_CBR1100XX
   You can see the specifications table that is created by this template:
http://wikimoto.org/wikimoto/index.php?title=Template:Specs
   If you notice, the "Lubrication" variable definition is missing
because I have not defined the variable in the code. Since that is the
case, I would like that row to NOT appear in the table.

Another EXAMPLE would be if I have this code in my page I don't want
ANY of the rows to appear:
{{Specs|
category= |
msrp= |
engine_type= |
displacement= |
compression_ratio= |
fuel_system= |
ignition_system= |
cooling_system= |
lubrication= |
bore_stroke= |
starter= |
transmission= |
final_drive= |
more_details= |
lxwxh= |
dry_weight= |
wet_weight= |
wheelbase= |
seat_height= |
fuel_capacity= |
front_suspension= |
rear_suspension= |
front_brakes= |
rear_brakes= |
tires= |
rake= |
trail= |
power= |
torque= |
top_speed= |
quarter_mile= |
power_weight= |
}}

Thanks ahead of time for even reading this.
Erik Mermagen
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l at Wikimedia.org
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l




More information about the MediaWiki-l mailing list