Hi Martin

I also go this from Souheil Chelfou:
Yes, it is possible.
The content provider is an adapter on the context, request and the view.
Be sure you have the right kind of objects. This message means that
your adapter can't be summoned.

I did also try to use ViewPageTemplateFile from Five, but my page fails with
  Module plone.app.content.browser.foldercontents, line 96, in render
  Module Shared.DC.Scripts.Bindings, line 313, in __call__
  Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec
  Module Shared.DC.Scripts.Bindings, line 1, in ?
  Module Shared.DC.Scripts.Bindings, line 293, in _getTraverseSubpath
AttributeError: 'str' object has no attribute 'other

Some background. I'm trying to add extra links in folder contents so I use plone.app.content as base. It boils down to subclassing tableview.Table and creating my own table.pt, and then glueing it with zcml. I also had to subclass all the classes in foldercontents.py due to scoping issues.

I can get my own folder contents up and running, but I want to use the provider expression in table.pt.

In tableview.py there is a line
"""
self.context = None # Need for view pagetemplate
"""
which I changed since I need context to be available in table.pt for the adaptation to succeed. (I don't know why context is explicitly set to None in plone.app.content). So I have context, request and view but it still fails.

I can get around the problem by not using viewlets in my folder contents, but I thought viewlets would be a nice approach.

Hedley


Martin Aspeli wrote:


Hedley Roos wrote:
Hi all

Is it possible to eg. <div tal:replace="structure provider:plone.portalfooter" /> in a page template which is instantiated by render = ViewPageTemplateFile("some_template.pt")?

I get "Unrecognized expression type "provider". in expression u'provider:plone.portalfooter'"


Wrong ViewPageTemplateFile. Try from Products.Five.browser.pagetemplatefile
import ViewPageTemplateFile.

Martin



_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers

Reply via email to