We usually see code using both of them. What's the motivation of using one or another?
I assume they are both the same. We talk of "browser views" at all places but usually never about "browser pages". I assume browser:page is coming from the Zope 3 world while the browser:view was added as alias at some point for having the notion of a browser view also within ZCML...wild theory...
-aj
According to the book "Web Component Development with Zope 3":
browser:page (page 514): Registers a browser page (view for browsers).
Parameters:
- allowed_attributes
- allowed_interface
- attribute
- class
- layer
- menu
- name
- permission
- template
- title
browser:view (page 518): Defines a browser view, possibly with subpages.
Parameters:
- allowed_attributes
- allowed_interface
- class
- for
- layer
- menu
- name
- permission
- provides
- title
You can see that a browser:view
can be registered for a specific (marker) interface, which is not possible for a browser:page
.
now I'm more confused than before
Nobody said Zope is easy and easy to understand
@tmassman you gave me the idea of searching zope official documentation.
http://docs.zope.org/zope3/ZCML/http_co__sl__sl_namespaces.zope.org_sl_browser/page/index.html
The page directive is used to create views that provide a single url or page. The page directive creates a new view class from a given template and/or class and registers it.
http://docs.zope.org/zope3/ZCML/http_co__sl__sl_namespaces.zope.org_sl_browser/view/index.html
The view directive defines a view that has subpages. The pages provided by the defined view are accessed by first traversing to the view name and then traversing to the page name.
Look at the book "Zope 3 - the bad parts"
mmm, now it start making sense: a page is something like a control panel configlet form… a view, is like a view for a content type… I guess.
The links don't seem to work anymore.
Meanwhile I had found https://apidoc.zope.org/++apidoc++/Interface/zope.app.publisher.browser.metadirectives.IPageDirective/index.html, but this currently yields a certificate error or, for the really fearless among us, an nginx welcome page.
Any current address, anyone?
See zope/browserpage/metadirectives.py.
zope.component.zcml.IBasicViewInformation
This is the basic information for all views.
zope.browserpage.metadirectives.IExpressionTypeDirective
Register a new TALES expression type
zope.browserpage.metadirectives.IPageDirective
The page directive is used to create views that provide a single url or page. The page directive creates a new view class from a given template and/or class and registers it.
zope.browserpage.metadirectives.IPagesDirective
Define multiple pages without repeating all of the parameters. The pages directive allows multiple page views to be defined without repeating the for
, permission
, class
, layer
, allowed_attributes
, and allowed_interface
attributes.
zope.browserpage.metadirectives.IPagesPageSubdirective
Subdirective to IPagesDirective
zope.browserpage.metadirectives.IViewDefaultPageSubdirective
Subdirective to IViewDirective.
zope.browserpage.metadirectives.IViewDirective
The view directive defines a view that has subpages. The pages provided by the defined view are accessed by first
traversing to the view name and then traversing to the page name.
zope.browserpage.metadirectives.IViewPageSubdirective
Subdirective to IViewDirective.