Snippets are useful for adding logic to websites. They can be used to create menus, determine who is logged in, or any other thing possible with the API.
Snippets can also be run inside of other snippets by using the MODx API:
You can optionally pass parameters to your snippet
Then inside your Snippet ("mySnippet"), you will have access to the corresponding variables via PHP's extract function, or you can access all parameters inside of the $modx object: