From 9cf5d3cbea6f5647b10015f63f5fe44434d1cfb4 Mon Sep 17 00:00:00 2001 From: Tom Gross Date: Sun, 30 Oct 2016 20:07:30 +0100 Subject: [PATCH] document HandlebarsPeristentTile and fix some typos --- README.rst | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index 6c77287..01ea6c6 100644 --- a/README.rst +++ b/README.rst @@ -33,6 +33,7 @@ The prodcut provides the following view components with handlebars support: - BrowserView - Plone template - Tile + - Persistent Tile Since portlets and viewlets do not make any assumtion on the templating and return everything which is returned by the @@ -41,7 +42,7 @@ render-method of the Renderer they are supported too. Examples -------- -A handlebar BrowserView: :: +A handlebars BrowserView: :: from collective.handlebars.browser.views import HandlebarsBrowserView @@ -100,7 +101,7 @@ And the according configure.zcml: :: -A handlebar portlet: :: +A handlebars portlet: :: from collective.handlebars.browser.views import HandlebarsMixin from plone.app.multilingual.browser.selector import LanguageSelectorViewlet @@ -127,9 +128,24 @@ A handlebar portlet: :: def render(self): return self.hbs_snippet(filename='langswitcher.hbs') -A handlebar tile: :: +A handlebars tile: :: - class ContactPersonTile(HandlebarTile): + class ContactPersonTile(HandlebarsTile): + + def get_contents(self): + """ Get CMS data and put it in a JSON format + """ + + return { + 'fullname': u'George Miller', + 'phone': '+1 50 206 67 99', + 'email': 'george@example.com', + } + + +Or a persistent handlebars tile: :: + + class ContactPersonTile(HandlebarsPersistentTile): def get_contents(self): """ Get CMS data and put it in a JSON format