Search code examples
mediawikisemantic-mediawiki

Multiple Values in one "SMW Page Forms" field


I ran into a problem with Semantic Mediawiki using the Page Forms extension. I wanted to create a field in a Page Form, that can take more than one value. So I decided to use the tokens input type.

The problem is the following: If I type some values into the form field and save the page, Page Form puts all the values - seperated with commas - into one single SMW value.

For example: I have a form that will create a page about a scientific paper. And in this form I have a field that is called Authors. And when I fill the field with two Authors, lets say Pascal and Tesla, then the final page does not have the two SMW values [[Author::Pascal]] and [[Author::Tesla]] - It has the SMW value [[Author::Pascal, Tesla]].

Does anyone know, how I can achieve the mapping from different values in the form field to different values as SMW strings?

Thanks and greets, J


Solution

  • Multiple values for the same field covers this.

    Put the following in your corresponding template:

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