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