See "Development Essentials" | Understanding macros.
https://www.lianja.com/doc/index.php/Understanding_Macros

and

Using parameterized Views....