Functions in templates

do it and more. No coding is necessary. Install and add "#xxx"

${query[[from index.tag "page"
    select { 
      ["Page #upper"] =  ref,
      Modified = lastModified }
    order by lastModified desc limit 5]] or "No empty pages."}

In your case, ["Test #stars"] should fine

ex:

I'm really enjoy every day this plugin.