Permanently protected template

Template:Showfact

From Historical Hastings
Template documentation[view] [edit] [history] [purge]

Purpose: Shows a single property in easier to read wikitext syntax. Text returned is intended for display and may have formatting or other transformations such as to the vernacular name in the local language. For dates, the illegal value of 9999 is treated as if the property was blank.

Compare with: {{Getfact}}- An alternative template intended for template writers examining values in the database. GetFact simply returns the value in the database and may be used for subsequent comparisons and other template processing. This is not so for {{Showfact}} values since they may have hidden formatting or have been transformed into a vernacular form.

Usage examples: On page Vandeleur Benjamin Crake (1816-1894) the following wikitext would produce these results.

Wikitext Result
{{showfact|surname}} Surname: Crake
{{showfact|sex|if blank=unknown}} Sex: Male
{{showfact|joined with|intro=Partner(s) |outro=,}} Partner(s) Joined with: Louisa Frances Browne (1817-1854)'"`UNIQ--ref-0001BDB4-QINU`"'+Mary Bedingfield Delves (1823-1906),
Parameter Description
1 the property to query
page if omitted, results are returned for the current page. Otherwise the query is performed on the page specified.
if blank if the query does not return anything, then the text with the "if blank" parameter is returned instead.
link/intro/outro these parameters are the same as in the SMW documentation for inline queries.

Performance note: Semantic MediaWiki exploits the caching mechanism of mediawiki software. Since the article is in memory, queries on its properties have virtually no cost, so a page may use large numbers of these queries without making the page slower.