Making portlet_events path dependenat

classic Classic list List threaded Threaded
2 messages Options
Fred Inklaar Fred Inklaar
Reply | Threaded
Open this post in threaded view
|

Making portlet_events path dependenat

I would like to have portlet events do the following:

1) Show only the events of the current folder in all folders (an the
pages they contain) but /
2) Show events for the whole site at / (and all pages in the / folder)

Do do this I created a copy op portlet_events,
/Plone/portal_skins/custom/portlet_events  

In the search I added a 'path' line:

<div metal:define-macro="portlet"
     tal:define="results python:here.portal_catalog.searchResults(
                 portal_type='Event',
                 path='/'.join(here.getPhysicalPath()),
                 end={'query': here.ZopeTime(),
                      'range': 'min'},
                 sort_on='start',
                 review_state='published')[:5];"
     tal:condition="results">

This works fine but for one thing: It only works for folders, not for
the pages/events/etc inside the folder. This is of course because the
current page is then added to the path.

How do I remove that additional bit from the path? The site goes only
one level deep, so might there be a better solution to this problem?



-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Plone-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
Kamal Gill Kamal Gill
Reply | Threaded
Open this post in threaded view
|

Re: Making portlet_events path dependenat

For non-folderish items, define path as

path='/'.join(here.aq_parent.getPhysicalPath()),

hth,
Kamal

On Oct 16, 2005, at 9:02 AM, Fred Inklaar wrote:

> I would like to have portlet events do the following:
>
> 1) Show only the events of the current folder in all folders (an the
> pages they contain) but /
> 2) Show events for the whole site at / (and all pages in the / folder)
>
> Do do this I created a copy op portlet_events,
> /Plone/portal_skins/custom/portlet_events
>
> In the search I added a 'path' line:
>
> <div metal:define-macro="portlet"
>      tal:define="results python:here.portal_catalog.searchResults(
>                  portal_type='Event',
>                  path='/'.join(here.getPhysicalPath()),
>                  end={'query': here.ZopeTime(),
>                       'range': 'min'},
>                  sort_on='start',
>                  review_state='published')[:5];"
>      tal:condition="results">
>
> This works fine but for one thing: It only works for folders, not for
> the pages/events/etc inside the folder. This is of course because the
> current page is then added to the path.
>
> How do I remove that additional bit from the path? The site goes only
> one level deep, so might there be a better solution to this problem?
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by:
> Power Architecture Resource Center: Free content, downloads,  
> discussions,
> and more. http://solutions.newsforge.com/ibmarch.tmpl
> _______________________________________________
> Plone-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/plone-users
>



-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Plone-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users