zope - Customize Plone view class without touching the template -
zope - Customize Plone view class without touching the template -
if view registered this, template definition in zcml:
<browser:page name="original-view" class=".original_view.view" permission="zope2.view" for="*" template="original_template.pt" /> and want customize class in product, there way without customizing template?
you have wrap browser:page <configure package='xxxx'>
that means in scope of packge.
example:
class="lang-xml prettyprint-override"><configure package="original.package.browser"> <!-- custom view --> <browser:page name="original-view" class="your.package.browser.view" <!-- total dotted name custom view class --> permission="zope2.view" for="*" layer="your.package.interfaces.iyourpackagelayer" <!-- should provide browserlayer, otherwise got configuration conflict --> template="original_template.pt" <!-- template original.package.browser --> /> </configure> edit:
as @sdupton mentioned, updated illustration code snipped layer if can't utilize layer (browserlayer) can set code, without layer attribute overrides.zcml
you can specify more precise interface in for attribute
plone zope zcml
Comments
Post a Comment