By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,767 Members | 1,098 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,767 IT Pros & Developers. It's quick & easy.

How to render a template page by calling its method from TAL portlet(@@manage-portlet

P: 5
I want to know that how to call a method which is in file system (createPictMenu.py in my case) from TAL Portlet(from zmi) which is in @@manage-portlets(in the Add Portlet drop down list).
I did like this

1.Created one new class for the address(tal portlet) in my createPictMenu.py
2.I then registered the portlet in configure.zcml.

Here is my code bit:

Expand|Select|Wrap|Line Numbers
  1.  
  2.       class address_tal(BrowserView)
  3.  
  4.          def myaddress()
  5.              address_bar = ViewTemplatePageFile('templates/address_left.pt')--> (this 
  6.              is  the template page which i want in my newly created address portlet manage-     
  7.              portlets)
  8.  
And my configure.zcml looks like this :
Expand|Select|Wrap|Line Numbers
  1.          <plone:portlet
  2.          name="collective.portlet.tal.TALPortlet"
  3.          interface="collective.portlet.tal.talportlet.ITALPortlet"
  4.          assignment="collective.portlet.tal.talportlet.Assignment"
  5.          view_permission="zope2.View"
  6.          edit_permission="cmf.ManagePortal"
  7.          renderer=".browser.createPictMenu.address_tal"
  8.          addview="collective.portlet.tal.talportlet.AddForm"
  9.          editview="collective.portlet.tal.talportlet.EditForm"
  10.          />
  11.  

And in Zmi:

In zmi i did the following things localhost:8080/myproject/@@manage-portlets --> AddPortlet(dropdown list)--> selected TAL Portlet option-> Then i gave title as address and for description i given the code to call the address_tal from createPictMenu.py.

address_tal:

Expand|Select|Wrap|Line Numbers
  1.         <span tal:define="global li python:view.myaddress()">
  2.                <span tal:replace="structure python:li" /> 
  3.         </span> 
  4.  
i dont know how to call a method of a file which is in file system from zmi @@manage-portlets->TAL portlet. Please help
Aug 28 '13 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.