Template icon indicating copy to clipboard operation
Template copied to clipboard

Plugins

Open augustohp opened this issue 14 years ago • 3 comments

Plugins are a way of adding a different behavior when decoration elements, examples of plugins are:

  • Custom rendered elements (The date/calendar element you just spoken on issue #4)
  • Using a specific decorator
  • Escape HTML data

How designer could use them:

<div id="post-comments" class="respect-escape-html"></div>

Or we could use data attribute, but classes just seem a little bit better and we can use them as selectors also. Waiting your considerations ...

augustohp avatar Dec 15 '11 04:12 augustohp

Custom rendered elements are bad, since the designer would never see them before the developer did his part. Not sure how we solve this problem, but the designer should never rely on PHP to see how the template really are, this is the most critical flaw of every template engine out there.

Escaping and filtering seems good, we need to come up with real use cases.

alganet avatar Dec 15 '11 09:12 alganet

Another real use cases:

  • EmptyDecorator - Used when no data is passed by the backend (There is no data to show in this table) or when the designer does not want the element to show when there is no data passed by the backend
  • TemplateDecorator - Used when some pre-defined element(s) by the designer are used by the Template (Ex: Zebra rows)

augustohp avatar Dec 15 '11 17:12 augustohp

An idea is that a plugin is always an adapter or/and a decorator. Another ideas to plugins ...

  • l10n / i18n plugin
  • Asset manipulation (images as sprites, concat css and javascript)
  • Google Analytics plugin

augustohp avatar Dec 20 '11 19:12 augustohp