Vampire V5
Privacy policy
About Vampire V5
Disclaimers
Editing
Template:Infobox/doc
(section)
From Vampire V5
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Making fields optional=== A row with a label but no data is not displayed. This allows for the easy creation of optional infobox content rows. To make a row optional use a parameter that defaults to an empty string, like so: <pre> |label5 = Population |data5 = {{{population|}}} </pre> This way if an article doesn't define the population parameter in its infobox the row won't be displayed. For more complex fields with pre-formated contents that would still be present even if the parameter wasn't set, you can wrap it all in an "#if" statement to make the whole thing vanish when the parameter is not used. For instance, the "#if" statement in the following example reads "#if:the parameter ''mass'' has been supplied |then display it, followed by 'kg'": <pre> |label6 = Mass |data6 = {{#if:{{{mass|}}}|{{{mass}}} kg}} </pre> For more on #if, see [[meta:ParserFunctions##if:|here]]. You can also make headers optional in a similar way. If you want a header to appear only if one or more of the data fields that fall under it are filled, one could use the following pattern as an example of how to do it: <pre style="overflow:auto;">{{Infobox |name = {{subst:PAGENAME}} |title = Example of an optional header |header1 = {{#if:{{{item_one|}}}{{{item_two|}}}{{{item_three|}}}|Optional header}} |label2 = Item one |data2 = {{{item_one|}}} |label3 = Item two |data3 = {{{item_two|}}} |label4 = Item three |data4 = {{{item_three|}}} }}</pre> header1 will be shown if any of item_one, item_two, or item_three is defined. If none of the three parameters are defined the header won't be shown. The trick to this is that the "if" returns false only if there is nothing whatsoever in the conditional section, so only if all three of item_one, item_two and item_three are undefined will the if statement fail.
Summary:
Please note that all contributions to Vampire V5 may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
V5:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Main Page
About
Help
FAQ
Create account
Log in
Find
Browse
Main page
Kindred Basics
Lexicon
Clans
Disciplines
Attributes
Skills
Advantages & Flaws
Resonance
Predator Type
Edit
Edit
This page
Template
Discussion
View history
My pages
Not logged in
Talk
Contributions
Recent changes
Tools
What links here
Related changes
Special pages
Page information