Parser Functions: Difference between revisions

From SemanticOrganization
Jump to: navigation, search
Line 145: Line 145:


=== #semorg-forminput ===
=== #semorg-forminput ===
This parser function is an abbreviation to call <code><nowiki>{{#forminput}}</nowiki></code> with smart defaults.
{| class="table table-bordered table-condensed"
! Markup !! Result
|-
|<code><nowiki>{{#semorg-forminput:group}}</nowiki></code>
|{{#semorg-forminput:group}}
|}
The following system messages control the appearance of the list:
{| class="table table-bordered table-condensed"
! Message !! Function
|-
|semorg-forminput-<feature>-button-text
|The button text to be displayed.
|-
|semorg-forminput-<feature>-size
|Use this to set a wiki-wide default for all calls of <code><nowiki>{{#semorg-forminput:<feature>}}</nowiki></code>
|-
|semorg-forminput-<feature>-default-value
|
|-
|semorg-forminput-<feature>-query-string
|
|-
|semorg-forminput-<feature>-autocomplete-on-category
|
|-
|semorg-forminput-<feature>-autocomplete-on-namespace
|
|-
|semorg-forminput-<feature>-placeholder
|
|-
|semorg-forminput-<feature>-popup
|
|-
|semorg-forminput-<feature>-returnto
|
|}
The following parameters are available:
{| class="table table-bordered table-condensed"
! Parameter !! Description
|-
|button text, size, default value, query string, autocomplete on category, autocomplete on namespace, placeholder, popup, returnto
|These are the default parameters for Page Form's <code><nowiki>{{#forminput}}</nowiki></code> function
|}


=== #semorg-meetings ===
=== #semorg-meetings ===

Revision as of 17:27, 11 December 2018

#semorg-person

called like this (preferably via template):

{{#semorg-person:
 |ref={{FULLPAGENAME}}
 |prefix={{{prefix|}}}
 |firstname={{{firstname|}}}
 |lastname={{{lastname|}}}
 |name={{{firstname|}}} {{{lastname|}}}
 |suffix={{{suffix|}}}
 |workstreet={{{workstreet|}}}
 |workpostalcode={{{workpostalcode|}}}
 |worklocality={{{worklocality|}}}
 |email={{{email|}}}
 |workphone={{{workphone|}}}
 |homepage={{{homepage|}}}
 |note={{{note|}}}
 |organization={{{organization|}}}
 |gender={{{gender|}}}
}}

sets all the attributes and spits out a nicely formatted table with all the contact information and also a download link for a .vcard file

#semorg-person-ref

#semorg-form

#semorg-field

#semorg-fields

#semorg-field-rows

#semorg-set

#semorg-set-list

#semorg-table

#semorg-subobject

#semorg-network

#semorg-cooperation

#semorg-circles

#semorg-toggle

#semorg-list

This parser function is used to show lists of pages belonging to a certain category.

Markup Result
{{#semorg-list:group}}
NameHostMembers
Former Group
inactive
this group isn't active any more
John Doe
Testgroup
describing the group
John Doe Jane Doe
Testgroup 2
Group for testing purposes
Jane Doe Jane Doe, John Doe
Testing numbered group names
Jane Doe John Doe, Jane Doe
Testing numbered groups
Group's description
Jane Doe Ad Min
Former Group
inactive
this group isn't active any more
Testgroup
describing the group
Testgroup 2
Group for testing purposes
Testing numbered group names
Testing numbered groups
Group's description

The following system messages control the appearance of the list:

Message Function
semorg-list-<feature>-headers Should contain a list of message keys that contain the texts for the table headers. For the example above the content of semorg-list-group-headers is “group-name, group-description, group-host, group-members“. The elements of the list should have the general form of <feature>-<field>. The list is used to reference another set of messages following the naming convention semorg-field-<feature>-<field>-name. So semorg-field-group-name-name is used to populate the heading of the first column in the example above.

The following parameters are available:

Parameter Description
category The default category is the content of semorg-<feature>-category. If you want to use a different category, you can overwrite the default using this parameter.
row template The parser function constructs a query that calls a template for every row. The default value is the same as the name of the feature. The actual name of the template called should be semorg-<row template>-row. You'll have to provide it on your own if you want to replace the default.
query You can add additional query conditions using Semantic MediaWiki's syntax. For example, if you would like to list only active groups, just add query=[[semorg-group-active::true]].
?<field-name> By default, the parser function queries all fields that are defined for the feature and passes them on to the row template as [Help:Template_format#Usage_for_template_arguments.3D.5Bnamed.7Clegacy.5D_.28named_args.29 named args]. You can add custom lines to query for your custom fields or for chained properties. For example, if you would like to use the city of the group's host in the row template you could add |?semorg-group-host.semorg-person-email=email.

In order for this to work, you will need to use the row template parameter to call your custom template, where you can then use {{{?email|}}} to get the value. You can customize the headers if you also create a semorg-list-<row template>-headers system message. If a message of that name doesn't exist, the default semorg-list-<feature>-headers message will be used.

sort, order, default, limit These are the standard parameters for {{#ask}} queries.

#semorg-user-create

#semorg-formlink

This parser function is an abbreviation to call {{#formlink}} with smart defaults.

Markup Result
{{#semorg-formlink:meeting}}

The following system messages control the appearance of the list:

Message Function
semorg-formlink-<feature>-link-text The link text to be displayed.
semorg-formlink-<feature>-link-type Use this to set a wiki-wide default for all calls of {{#semorg-formlink:<feature>}}
semorg-formlink-<feature>-target
semorg-formlink-<feature>-tooltip
semorg-formlink-<feature>-popup
semorg-formlink-<feature>-new-window
semorg-formlink-<feature>-query-string
semorg-formlink-<feature>-returnto

The following parameters are available:

Parameter Description
link text, link type, target, tooltip, popup, new window, query string, returnto These are the default parameters for Page Form's {{#formlink}} function

#semorg-forminput

This parser function is an abbreviation to call {{#forminput}} with smart defaults.

Markup Result
{{#semorg-forminput:group}}

The following system messages control the appearance of the list:

Message Function
semorg-forminput-<feature>-button-text The button text to be displayed.
semorg-forminput-<feature>-size Use this to set a wiki-wide default for all calls of {{#semorg-forminput:<feature>}}
semorg-forminput-<feature>-default-value
semorg-forminput-<feature>-query-string
semorg-forminput-<feature>-autocomplete-on-category
semorg-forminput-<feature>-autocomplete-on-namespace
semorg-forminput-<feature>-placeholder
semorg-forminput-<feature>-popup
semorg-forminput-<feature>-returnto

The following parameters are available:

Parameter Description
button text, size, default value, query string, autocomplete on category, autocomplete on namespace, placeholder, popup, returnto These are the default parameters for Page Form's {{#forminput}} function

#semorg-meetings