Once Snippets is installed, open Components > Regular Labs - Snippets. This component lists all snippets you have created.
Select New to create a snippet. The edit screen contains the snippet text, its identifying details, Pro variables, and output settings.
Details and text
Give the snippet a Title and, optionally, a custom Alias. Enter the content in the editor just as you would enter article content. A snippet can contain formatted text, HTML, plugin tags, and other content accepted by the editor.
| Title | Give the snippet a recognizable name. |
| Alias | Optionally override the alias generated from the title. You can use the ID, alias, or title when inserting the snippet. |
| Status | Publish or unpublish the snippet. An unpublished snippet produces no rendered snippet content; the global Place HTML comments setting can add a diagnostic comment. |
| Description | Add an administrator-only description. In list views, text after --- is available as extra information instead of being shown in the main description. |
| Category | Select or create a category when categories are enabled in the component configuration. |
| Color | Assign a color used in the administrator list when colors are enabled. |
Variables PRO
Pro lets you define variables under the Variables tab and pass their values through the snippet tag. Each variable has a key, an optional default value, and an Insert in Tag choice.
Insert in Tag controls whether the editor button includes that variable as an attribute. The per-snippet Show Variables Fill Wizard setting can use the global choice, disable the wizard, or display a form in which the variable values can be entered before the tag is inserted.
See Using Dynamic Variables for the complete syntax and value precedence.
Options
Most snippet options can use the global value from Configuration or override it for one snippet.
| Remove Paragraph Tags | Remove surrounding paragraph tags and replace paragraph tags inside the snippet with double line breaks. This is useful for snippets placed inline inside a sentence. Options: Use Global, No, Yes |
| Place HTML comments | Place HTML comments around this snippet's successful output. The global Place HTML comments setting also controls diagnostic comments for missing, unpublished, or recursive snippets. Options: Use Global, No, Yes |
| Enable in HTML Head | Choose whether this snippet can be replaced in the HTML head. Remove removes its matching tag from the head without inserting the snippet content. Options: Use Global, No, Yes, Remove |
| Show in Editor Button List | Control where this snippet appears in the editor-button list. Options: No, Yes, Only in Admin Pro only. |
Duplicating, exporting, and importing snippets
The Snippets component provides these item-management actions in both Free and Pro.
Duplicate
Select one or more snippets in the component list and choose Actions > Duplicate. Each selected snippet is copied to a new item that you can edit independently.
Export
Select the snippets you want to transfer or back up and choose Actions > Export. Snippets downloads the selected snippet data as a JSON file.
Import
Select Import, choose a Snippets JSON export no larger than 5 MB, and choose how the imported snippets should be published:
- Yes publishes every imported snippet.
- No imports every snippet as unpublished.
- As exported retains the published state stored in the export.
Imported snippets are created as new items; they do not update snippets already in the component. The available actions and publication choices depend on your Joomla component permissions.
