Skip to main content
Version: 2024.3

Snippet Editable

General

Use the snippet editable to embed a document snippet, for example teasers or other boxes into your document.

Snippets are like little pages which can be embedded in other documents. You have to create them the same way as other documents (pages).

Configuration

NameTypeDescription
defaultHeightintegerA default height if the element is empty
heightintegerHeight of the snippet in pixel
reloadboolReload document on change
titlestringYou can give the element a title
widthintegerWidth of the snippet in pixel
classstringA CSS class that is added to the surrounding container of this element in editmode
cacheboolEnable cache for rendered snippet

Methods

NameReturnDescription
getId()intID of the assigned snippet
getSnippet()SnippetThe assigned snippet object
isEmpty()boolWhether the editable is empty or not.

Examples

Basic Usage

{{ pimcore_snippet("mySnippet", {"width": 250, "height": 100}) }}

Caching

By default caching is disabled. You can enable snippet caching by passing the configuration cache: true or by enabling the full page cache. Regardless if you're using the full page cache or not it's a good practice to enable the cache directly on the editable if the snippet result should be cached.

{{ pimcore_snippet("mySnippet", {cache: true}) }}