Martin Aspeli wrote:
Alex Clark wrote:
Hi all,
I understand (from PPD) I can reassign viewlets (e.g. move
personal_bar from top to contentviews), but if I just want to call
another view's methods from within "my view" what do I do?
E.g. I want to call view.portal_tabs from within the footer.
I was thinking something like tal:define="my_view @@sections_view" but
it seems you can't
call viewlets this way.
I don't think you can, but you can look up the viewlet in your view
class as a named multi-adapter on (context, request, view,
viewlet_manager) - you'll need to use 'self' for the view and look up
the viewlet manager as a multi-adapter on (context, request, view) in
the first place.
Martin
I would be nice to register those viewlets you want to render with a new
viewletmanager and then in the template do <tal:block replace="structure
provider:mymanager"/>, but I don't think you can use the TALES provider
statement in a ViewPageTemplateFile from Five.
I do think it is possible to lookup the viewlet in a page template and
then do <tal:block replace="structure python:myviewlet.render()"/>
Hedley
_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers