Snippets | Flextype

Snippets

Snippets are some sort of extensions written on PHP/HTML/JS languages that add different features on the site.

Snippets are stored in /site/snippets/ directory. You can edit snippets manually using any text editor or via the Admin panel in the snippets section.

Using snippets in the entry content

You can display snippet in the entry content with a shortcode snippets_exec like this:

Using snippets in the templates

Display a snippet in the template by it's name:

{{ snippets.exec('snippet-name')|raw }}

Note: The raw filter marks the value as being "safe", which means that in an environment with automatic escaping enabled this variable will not be escaped if raw is the last filter applied to it.

Language: en, ru