O'Reilly logo

MODx Web Development by Antano Solar John

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 8. Snippets

We have been using snippets throughout this book without much detail on what they really are. In this chapter, you will learn more about snippets. We will explore the snippets that come with MODx and those that are available for downloading. You will learn how to install a snippet, use a snippet, and navigate its custom functionalities. As an example, we will be looking at one snippet called Jot and use it to allow comments on posts.

Working of snippets

Snippets are units of code that can be called from a resource or a template.

A snippet can do one or more of the following three things:

  • Return text or HTML
  • Populate template variables
  • Process a chunk and return its value

Almost anything that can be done in PHP can be done using a ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required