[Product-Developers] Re: constructing portlethash?
Martin Aspeli
optilude at gmx.net
Thu Feb 7 17:20:50 UTC 2008
Christian Klinger wrote:
> Hi Plone-Developers,
>
> i have a simple question, how can i construct a portlethash
> in my kss-view?
>
> Where do i get the values for my info dict??
>
> I found nothing on google.
>
> Maybe someone of you has an idea....
>
>
> thanks in advance
> christian
>
> info = dict(
> manager = 'plone.leftcolumn',
> category = 'context',
> key = '/new1',
> name = 'login',
> )
>
>
>
> class KSSDocZeichen(PloneKSSView):
> """ KSSDocZeichen """
>
> @kssaction
> def addDocZeichen(self, form={}, portlethash=None):
>
> Portlethash = hashPortletInfo(info)
> self.getCommandSet('plone').refreshPortlet(Portlethash)
> mac = self.macroField(field='doczeichen')
> core = self.getCommandSet('core')
> ....
This doesn't work?
In general, people tend not to construct them at all. Instead, you pass
the portlethash from the template as a "kssattr" variable and just use
it directly.
Martin
--
Author of `Professional Plone Development`, a book for developers who
want to work with Plone. See http://martinaspeli.net/plone-book
More information about the Product-Developers
mailing list