Help:Tree format

From Linux Web Expert

Revision as of 07:54, 6 February 2023 by >AdSvS (→‎Example)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Tree format
Displays query results as a tree (nested HTML bulleted lists)
Further Information
Provided by: Semantic Result Formats
Added: 1.7.1
Removed: still supported
Requirements: none
Format name: tree
Enabled? Indicates whether the result format is enabled by default upon installation of the respective extension. yes
Authors: Stephan Gambke
Categories: misc
Keywords
template · tree
Table of Contents

The result format tree, part of the Semantic Result Formats extension, can be used to display the query result as a tree, i.e. as an unordered (bulleted) nested HTML list. This result format is very similar to the result format oltree which is used to format query results as numbered lists instead of bulleted lists.

The format ultree is just an alias of this result format.

Parameters

⧼validator-describe-header-parameter⧽ ⧼validator-describe-header-aliases⧽ ⧼validator-describe-header-type⧽ ⧼validator-describe-header-default⧽ ⧼validator-describe-header-description⧽
propsep - ⧼validator-type-string⧽ , The separator between the properties of a result entry
valuesep - ⧼validator-type-string⧽ , The separator between the values for a property of a result
template - ⧼validator-type-string⧽ ⧼validator-describe-empty⧽ The name of a template with which to display the printouts
named args namedargs ⧼validator-type-boolean⧽ no Name the arguments passed to the template
userparam - ⧼validator-type-string⧽ ⧼validator-describe-empty⧽ A value passed into each template call, if a template is used
class - ⧼validator-type-string⧽ ⧼validator-describe-empty⧽ Specify an additional cascading style sheet class
introtemplate - ⧼validator-type-string⧽ ⧼validator-describe-empty⧽ The name of a template to display before the query results, if there are any
outrotemplate - ⧼validator-type-string⧽ ⧼validator-describe-empty⧽ The name of a template to display after the query results, if there are any
sep - ⧼validator-type-string⧽ , The separator between results
prefix - ⧼validator-type-string⧽ none Control display of namespace in printouts
parent - ⧼validator-type-string⧽ ⧼validator-describe-empty⧽ The property containing the parent page
root - ⧼validator-type-string⧽ ⧼validator-describe-empty⧽ The root page of the tree
start level - ⧼validator-type-integer⧽ 1 The start level of the tree, e.g. for integrating it into another tree
template arguments - ⧼validator-type-string⧽ ⧼validator-describe-empty⧽ Sets how the named arguments are passed to the template

Example

A query for this format could look like:

{{#ask:
 [[Category:Place]]
 [[Located in::+]]
 |?Population
 |format=tree
 |parent=Located in
}}

Result:


Other examples

See also

  • TreeAndMenu extension - a bulleted list produced by this format can be transformed with the TreeAndMenu extension.
  • Help page on inheritance in hierarchies - includes a section on using this format to mimic hierarchical inheritance