On 05.05.09 03:09, Joe C wrote:
> Thanks for the help. I think I am getting underway. I did decide to use a
> class to build the alert as I need to look at the dates and type to decide
> what to display. Plus I only want to display the "alerts" viewlet if there
> are valid alerts present.
>
> Here is how I acquired the portal object:
>
> from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
> from plone.app.layout.viewlets.common import ViewletBase
> from Products.CMFCore.utils import getToolByName
>
> class AlertViewlet(ViewletBase):
> render = ViewPageTemplateFile('templates/alert.pt')
>
> def update(self):
> portal_url = getToolByName(self.context, "portal_url")
> portal = portal_url.getPortalObject()
> # Get the IDs of the objects in the alert folder
> alertItems = portal.alerts.objectIds()
Using objectIds() (Zope API!) in the context of Plone programming is usually
not appropriate. Use getFolderContents() or perform a catalog search
by 'path'.
-aj
begin:vcard
fn:Andreas Jung
n:Jung;Andreas
org:ZOPYX Ltd. & Co. KG
adr;quoted-printable:;;Charlottenstr. 37/1;T=C3=BCbingen;;72070;Germany
email;internet:[email protected]
title:CEO
tel;work:+49-7071-793376
tel;fax:+49-7071-7936840
tel;home:+49-7071-793257
x-mozilla-html:FALSE
url:www.zopyx.com
version:2.1
end:vcard
_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers