Skip to content

Instantly share code, notes, and snippets.

@ichim-david
Last active December 25, 2015 06:19
Show Gist options
  • Save ichim-david/6931740 to your computer and use it in GitHub Desktop.
Save ichim-david/6931740 to your computer and use it in GitHub Desktop.
browser view with macros property needed for version_history_form preview
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:browser="http://namespaces.zope.org/browser"
i18n_domain="plone">
<browser:page
for="*"
name="fiche_view"
class=".app.views.FicheView"
permission="zope2.View"
/>
</configure>
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from Products.Five.browser import BrowserView
class FicheView(BrowserView):
index = ViewPageTemplateFile('fiche_view.pt')
def __call__(self):
# call is needed to return self.index otherwise you get an error
# when trying to load a page as such: site/fiche_view
return self.index()
@property
def macros(self):
return self.index.macros
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment