| Creating Custom Velocity Tools | Configuring dotCMS Properties |
Macros can be placed directly inside of your plugin within the conf/macros-ext.vm file. If you declare a macro that already exists the previous macro will be commented out and yours macro will be used.
Custom macros can be written here as in the following example:
After creating the custom macro, and saving it to the recommended .vm file, it can then be called from any piece of content, container, or template as any other macro:#macro (newMacro $newMacroParameter)
Macro Code written here (or another file with macro code can be parsed or included)
#end
#newMacro($newMacroParameter)
*While it is possible to add macros to any velocity page, if you add them to the .vm files in the velocity root, then they are loaded once into memory and don't have to be parsed every time.
| Creating Custom Velocity Tools | Configuring dotCMS Properties |
Post a Comment