
This is first in series of tutorials about using T2 templates system. This post will focus on system basics. Second will be about standard ratings, third part will be about widgets and T2, and multi rating block and T2.
Main T2 panel show the list of all templates in the database. You can filter list by template type. For some templates you can see the name of tag this template replaces within some other templates. Every tag used in templates is in the form %TAG%, as it was before. You must use all capital letters.
For each templates type plugin installs one default template and maybe some extra/expanded templates. You can use any of existing templates to create your own. Default templates can’t be deleted or edited. Each template has one or more elements that are used in different situations, depending on template.
In the bottom of this panel there is an option to set default templates for each template type. These default templates will be used in case you don’t specify template for some type of rendering. This panel will feature some more options in te future, but for now this is it.
Types: Elements
These are very basic templates that don’t use any tags. Â They have 2 or more elements. For instance, Word Votes is used to set single and plural version of word vote/votes. Default is in english, but if you want it in some other language, duplicate that template, and you will get a editor panel. Give the template a name, and description (not necessary). Write singular and plural version of word vote, and save it. Similar is for all the other elemental templates. When you create your own templates, you can go to defaults panel, and set your templates as default.
Types: Rating Text
These templates have one or more elements, and support a number of tags. Some of these tags can be some other templates. Most of templates use Word Votes template. And you can select which template is used. If template is codependent in the elements side of the editor you see a selection box for such templates. When template is rendered, that dependent template will be rendered using the selection you set.
Types: Widgets
These templates are used for rendering widgets. If widget needs to display list of results, usually you need to set 3 elements: header, item and footer. Default templates use unordered lists, but you can use tables or divs if you want.
Templates in your own language
If you want to translate templates to any language, duplicate default ones, translate them and change if you want, save them, and set as defaults for future easier use. Also, don’t forget to change what templates are used on the settings panel for standard, comments and other types of ratings. All default templates will be only in english.
Few more posts about T2 will follow soon.
loading...








