Semantic Forms for selecting Categories

From semantic-mediawiki.org
Jump to: navigation, search

Semantic extension(s): Semantic Forms

Further extension(s): -/-

Keyword(s): -/-

Description:

The Semantic Forms extension can be used for selecting multiple categories using a form, to do this you need to create two pages and you will probably want to enable the edit with form feature.

Form:Categories

The Form:Categories is used to generate the edit with form page and it places code like this into the page it is used to edit:

{{Category
|Category=Category Name 1, Category Name 2, Category Name 3
}}

And this is the code to generate the multiple select form:


{{{field|Category|input type=categories|top category=Top_Category|height=200}}}

The Top_Category being the start of the category tree.

See the source of this page for an example: http://wiki.ikmemergent.net/index.php?title=Form:Categories

Template:Categories

The Template:Categories generates the category listing in the page:

[[Category:Category Name 1]]
[[Category:Category Name 2]]
[[Category:Category Name 3]]

From the code generated by the Form:Categories.

This is the code to transform the comma seperated list of categories into the format needed to place the page into the categories:


{{#arraymap:{{{Category}}}|,|x|[[Category:x]] | }}

See the source of this page for an example: http://wiki.ikmemergent.net/index.php?title=Template:Categories

See also