Download the PHP package hypejunction/elgg-snippets without Composer
On this page you can find all versions of the php package hypejunction/elgg-snippets. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hypejunction/elgg-snippets
More information about hypejunction/elgg-snippets
Files in hypejunction/elgg-snippets
Package elgg-snippets
Short Description Editable HTML snippets for use in themes and views
License GPL-2.0
Homepage http://hypejunction.com
Informations about the package elgg-snippets
HTML Snippets for Elgg
Reusable and editable snippets with variable interpolation
Features
Using plugin settings to alter large chunks of HTML is repetitive and not very efficient: you have to update plugins settings, remember in which plugin a setting lives, figure out how to populate default values, implement weird mechanics to interpolate variables etc.
This plugin makes it easy, just create a snippets in your views and will be available
for editing via admin interface. Snippets can then be injected into your views with
elgg_snippet()
.
Usage
Once the plugin is enabled, snippets can be edited under Admin > Appearance > HTML Snippets.
Create a default snippet as a .twig view anywhere in views/default/snippets/
:
Render a snippet where it belongs:
You can provide the title and the description of the snippet using translations:
Storage
Snippet overrides are stored in the dataroot, so be sure to copy them over if migrating your site. You can also reset to default template, by deleting a corresponding snippet from the dataroot.