Module:Sandbox/Rchard2scout/wpbsh

local p = {} --p stands for package

function p.test( frame ) count = countBanners( frame ) if count >= 6 then doCollapse = "yes" else doCollapse = "no" end return frame:expandTemplate{ title='WikiProject banner shell', args = { collapsed = doCollapse, frame.args[1] } } end

function countBanners( frame ) _, count = string.gsub(frame.args[1], "wpb%-header", "") return count end

return p