Template Morsels 1.x

Legacy documentation for Template Morsels 1.x.


Template Morsels caches using the database rather than the file system and thus allows you to cache portions of template code in a manner which performs better than normal EE template or tag caching. You can create morsels of code containing EE tags and variables inside the Template Morsels control panel, and then display them in your templates using the Fetch tag. These morsels will be refreshed based on refresh rules that you provide.

A morsel can accept just about anything for code. When you submit/save the code for that morsel in the control panel, it gets parsed right then and there and inserted into the database as static content.

You can refresh your morsels by connecting them to the editing of specific templates or to editing entries in specific blogs or to editing categories in specific category groups. You can also manually refresh cached morsels using the module control panel or set morsels to refresh on a time interval. This module also includes a dynamic morsels mode. This allows you to make morsels dependent on the context of the page. Dynamic morsels inherit refresh rules from the parent morsel to which they are related.

Use this module to greatly improve page performance by pre-processing parts of your templates that will change less often than every few seconds.

Template Morsels contains an additional feature that allows you to harvest content from Embeds. Every time you use an Embedded template in your templates, it causes a whole other set of template calls to the database for each, which results in deteriorated performance for loading the parent template.

By adding a simple parameter to your Embed tag, you can change the way EE retrieves the data. Rather than running another series of template calls, Template Morsels disables that portion and extracts the data back into your primary template and parses it inline. There is no caching involved, but this will improve site performance. Other than a few exceptions, you should be able to use this for most embedded templates.