Click here to Skip to main content
15,886,632 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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:

[code]

class address_tal(BrowserView)

def myaddress()
address_bar = ViewTemplatePageFile('templates/address_left.pt')--> (this
is the template page which i want in my newly created address portlet manage-
portlets)
[/code]
And my configure.zcml looks like this :
[code]
<plone:portlet xmlns:plone="#unknown">
name="collective.portlet.tal.TALPortlet"
interface="collective.portlet.tal.talportlet.ITALPortlet"
assignment="collective.portlet.tal.talportlet.Assignment"
view_permission="zope2.View"
edit_permission="cmf.ManagePortal"
renderer=".browser.createPictMenu.address_tal"
addview="collective.portlet.tal.talportlet.AddForm"
editview="collective.portlet.tal.talportlet.EditForm"
/>
[/code]


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:

[code]

< span tal:define="global li python:view.myaddress()" xmlns:tal="#unknown">
< span tal:replace="structure python:li" xmlns:tal="#unknown" />
< /span>

[/code]

i dont know how to call a method of a file which is in file system from zmi @@manage-portlets->TAL portlet. Please help
Posted
Updated 28-Aug-13 0:42am
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900