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 https://www.xwiki.org/xwiki/bin/view/Documentation/DevGuide/Tutorials/WritingMacros/WikiMacroTutorial/#HParameters

For example:

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

which displays as:

Screenshot 2023-12-07 at 11.22.14

See also https://www.xwiki.org/xwiki/bin/view/Documentation/DevGuide/Tutorials/WritingMacros/Using%20custom%20pickers%20for%20XWiki%20Rendering%20Macro%20parameters/ 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:

Hope it helps