Skip to main content

Overview

A Plone Portlet which does an adapter lookup to fetch the portal type to use in the query for recently changed portlets.

Rationale

This is scratching an itch of a customer, which wants to display only recent “news” on a news page etc. Instead of hard-coding the portal type, we do a adapter lookup.

Usage

Users then can register adapters like:

<adapter
    for=".interfaces.INewsArea
         zope.publisher.interfaces.browser.IBrowserRequest
         zope.publisher.interfaces.browser.IBrowserView
         "
    provides="inquant.portlet.contextualrecentitems.interfaces.ITypeNameProvider"
    factory=".adapters.FeedItemTypeProvider"
    />

<five:implements
    class="Products.feedfeeder.content.folder.FeedfeederFolder"
    interface=".interfaces.INewsArea"
    />

And have the actual adapter look like:

class FeedItemTypeProvider(object):
    def __init__(self, context, request, view):
        pass
    type = "FeedFeederItem"

The portlet renderer does a queryMultiAdapter on the context, the request and the view. Thus, it’s possible to have a different portlet for each view of your content. This is useful for search pages registered on the site root:

<adapter
    for="zope.interface.Interface
         zope.publisher.interfaces.browser.IBrowserRequest
         Products.BabpnProducts.browser.search.BabpnBOSearchView"
    provides="inquant.portlet.contextualrecentitems.interfaces.ITypeNameProvider"
    factory=".adapters.BizOpTypeProvider"
    />

class BizOpTypeProvider(object):
    def __init__(self, context, request, view):
        pass
    type = "BusinessOpportunity"

That way, the recent changes portlet only shows items which match your search page.

Of course, if no adapter is found, the portlet falls back to its normal behavior like the standard plone recently changed portlet.

Release files for inquant.portlet.contextualrecentitems 0.2.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for inquant.portlet.contextualrecentitems 0.2.5
File Size Uploaded
inquant.portlet.contextualrecentitems-0.2.5.tar.gz 14.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for inquant.portlet.contextualrecentitems 0.2.5
File Interpreter ABI Platform
inquant.portlet.contextualrecentitems-0.2.5-py2.4.egg Legacy Egg format - - Details

Total release size: 38.5 kB

Release files / inquant.portlet.contextualrecentitems-0.2.5.tar.gz

Download URL inquant.portlet.contextualrecentitems-0.2.5.tar.gz
Size 14.1 kB
Tags Source
SHA-256 checksum
How to use checksums
53b5f33578849686069d80f269747ea325a070f93f915895b3eecb14424dc5d3
BLAKE2b-256 checksum
How to use checksums
50b38f620c419b8ced22ee912f7a522c97decbbb1ea0f4a927d5172945e2cc74
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / inquant.portlet.contextualrecentitems-0.2.5-py2.4.egg

Download URL inquant.portlet.contextualrecentitems-0.2.5-py2.4.egg
Size 24.4 kB
Tags Egg
SHA-256 checksum
How to use checksums
26c4f2cf9fa3bc49c0f8ecef1ad538f082d76585e8861d1fbd1e789e31399223
BLAKE2b-256 checksum
How to use checksums
597cfceb67e5f3ac4da9eb55109a6c3a662447edb8ae7f12ec07539bace6df29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.2.5 This release

2 release files

0.2.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page