Possible to use multi value macro parameters?

I’m trying to improve the Show Children by Tag macro by allowing for entering multiple tags as a paramater.

Is it possible to enable multiple entries in a macro parameter?

If so, I believe something like the below might work; thoughts?

  ## Get the current page reference
  #set ($tags = $wikimacro.parameters.tag)
  ## Get the children pages of the current page
  #set ($childrenPages = $doc.getChildren())
  #if ($wikimacro.parameters.Sort)
    #set ($childrenPages=$sorttool.sort($childrenPages))
  #end 
  ## Iterate over the children pages
  #foreach ($childRef in $childrenPages)
    ## Get the tags of the child page
    #set ($childTags=$xwiki.tag.getTagsFromDocument($childRef))
    ## Check if the child page has the given tag
    #set ($match = false)
    #foreach ($tag in $tags)
      #if ($childTags.contains($tag))
        #set ($match = true)
      #end
    #end
    #if ($match)
      ## Display a link to the child page
      * [[$childRef]]
    #end
  #end

Yes it’s possible. You need to specify the wiki macro parameter type as java.util.List<java.lang.String>. See Writing XWiki Rendering Macros in wiki pages (XWiki.org)

For example:

Screenshot 2023-12-07 at 11.21.14

Then you’ll get a collection object, as in:

Screenshot 2023-12-07 at 11.21.52

which displays as:

Screenshot 2023-12-07 at 11.22.14

See also Using pickers for XWiki Rendering Macro parameters (XWiki.org) for the consequences on the WYSIWYG. Here, since java.util.List<java.lang.String> is not known by the WYSIWYG, you’ll simply get a comma-separated string to enter, as in:

Screenshot 2023-12-07 at 11.23.27

Hope it helps