This project is read-only.

Documentation

This module is about creating templates of contents; don't confuse it with html templating.

Installation and usage

After installing and enabling the module you will have a new content part available, the Template part. You can add this to content types where you want to have the ability of using templates.

Templates are about sharing structural similarities between content items of the same type; they're not about sharing styling. E.g. you could have templates for the Page content type like "Book review", "Restaurant review", each having a structural guideline to use when creating new items that should store corresponding content.

For items having the Template part attached you have two options when creating them (and by design only when creating):
  • Save the item as template (by clicking the button to the right of "Save")
  • Initialise the item from a template: by selecting a template content item and marking what to load from it you can load the default content into the item

What you can load from templates is determined by template loaders: these are the checkboxes when initialising from a template where you can select what to load from a template. By default only one template loader is implemented, to load in body text.

Extending template loaders

Since it's not obvious what should be loaded from a template's parts or fields Content Templates uses and extensible set of template loaders to copy data from the template to the item.
By default only a loader for copying the body text is implemented. Creating your own implementation is very simple, just implement the ITemplateLoader interface. Check out BodyTemplateLoader for an example.

Version history

  • v1.0 (00.02.2013):

Last edited Jan 31, 2013 at 9:23 PM by Piedone, version 2

Comments

No comments yet.