What's exactly the difference between browser:view and browser:page in zcml directives?

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.

1 Like

now I'm more confused than before :slight_smile:

1 Like

Nobody said Zope is easy and easy to understand :wink:

2 Likes

@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.

1 Like

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?

What I usually do...

Go to archive.org and paste the broken URL. Often there is a copy available.

Thank you; indeed, they have crawled it once (July 2009): Zope 3 apidoc

1 Like

Plone Foundation Code of Conduct