Macros are basically functions (and a good way to reuse code). You can input numerous values into the function do this by not including a comma.
The important part of the macro is the first line: #macro is just the command to call a macro, then inside the brackets you must place the name of the macro, in this case the function macro is called contentType. After the macro name you include the values.
The example below picks up the type and then displays an image based on the contentType or $type.
A macro itself in full looks like the following:
#macro (contentType $type) #if($type=="blog") <img src="/application/assets/images/blog-badge-small.png" alt="blog"> #elseif($type=="photo") <img src="/application/assets/images/photo-badge-small.png" alt="photo"> #elseif($type=="video") <img src="/application/assets/images/video-badge-small.png" alt="video"> #elseif($type=="events") <img src="/application/assets/images/event-badge-small.png" alt="event"> #end #end
To call a macro use the following line. The name of the macro is contentType. Place a value or two between the brackets: