Template:Infobox Character: Difference between revisions

From My Fan Fiction
Jump to navigation Jump to search
m (Skca54admin moved page Template:Infobox to Template:Infobox Character without leaving a redirect)
No edit summary
Line 1: Line 1:
{| style="border: 1px solid; width:25em; float: right; font-size: 90%;"
|-
|colspan="2" style="text-align: center;"| '''{{{Name}}}'''
|-
! [[Property:Population | Population]]
| [[Population::{{{Pop}}}]]
|-
! [[Property:Area | Area]]
| [[Area::{{{Area}}} sq mi]]
|}
<noinclude>This is a greatly simplified adaptation of the template from [[wikipedia:{{FULLPAGENAME}}]].
<noinclude>This is a greatly simplified adaptation of the template from [[wikipedia:{{FULLPAGENAME}}]].


Line 9: Line 24:


The table appears below in this template page (we could hide it with <nowiki><includeonly></nowiki>).  You don't see any factbox for this dummy table because in this Semantic MediaWiki installation, semantic annotations are not enabled in the Template namespace.</noinclude>
The table appears below in this template page (we could hide it with <nowiki><includeonly></nowiki>).  You don't see any factbox for this dummy table because in this Semantic MediaWiki installation, semantic annotations are not enabled in the Template namespace.</noinclude>
{| style="border: 1px solid; width:25em; float: right; font-size: 90%;"
|-
|colspan="2" style="text-align: center;"| '''{{{Name}}}'''
|-
! [[Property:Population | Population]]
| [[Population::{{{Pop}}}]]
|-
! [[Property:Area | Area]]
| [[Area::{{{Area}}} sq mi]]
|}
<!-- now some annotations that don't appear in the template -->
<!-- now some annotations that don't appear in the template -->
<includeonly> [[Category:States of the United States]] [[Located in::United States of America| ]] </includeonly>
<includeonly> [[Category:States of the United States]] [[Located in::United States of America| ]] </includeonly>
<noinclude> [[Category:Sample pages]] </noinclude>
<noinclude> [[Category:Sample pages]] </noinclude>

Revision as of 20:44, 28 June 2016

{{{Name}}}
Population [[Population::{{{Pop}}}]]
Area [[Area::{{{Area}}} sq mi]]



This is a greatly simplified adaptation of the template from wikipedia:Template:Infobox Character.

This version embeds semantic annotation inside the template, so the template both displays information in a table and records semantically meaningful properties. Such semantic templates simplify adding semantics to recurring elements in wiki pages.

Note this table does not handle missing values for Population and Area. That can be done using <source enclose="none" lang="bibtex"></source> from the MediaWiki ParserFunctions extension, but using conditionals in a table requires tricky syntax to mix pipe ' | ' symbols for layout and expressions (see wikipedia:Wikipedia:Conditional_tables).

The table appears below in this template page (we could hide it with <includeonly>). You don't see any factbox for this dummy table because in this Semantic MediaWiki installation, semantic annotations are not enabled in the Template namespace.