Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Portlets are registered as utilities with the <code>IPortletType</code> interface with the zope component machinery. These registrations are generated for you when registering portlets with portlets.xml. The portlet management UI then uses these utility registrations to enumerate portlets you can add.</p> <p>Luckily, <code>plone.portlets.utils</code> provides a handy API to unregister these portlets again:</p> <pre><code>def unregisterPortletType(site, addview): """Unregister a portlet type. site is the local site where the registration was made. The addview should is used to uniquely identify the portlet. """ </code></pre> <p>The <code>addview</code> parameter is a string, and is the same as used in a portlet.xml registration. For example, the calendar portlet is registered as:</p> <pre><code>&lt;portlet addview="portlets.Calendar" title="Calendar portlet" description="A portlet which can render a calendar." i18n:attributes="title; description" &gt; &lt;for interface="plone.app.portlets.interfaces.IColumn" /&gt; &lt;for interface="plone.app.portlets.interfaces.IDashboard" /&gt; &lt;/portlet&gt; </code></pre> <p>You can thus remove the calendar portlet from your site by running the following code snippet:</p> <pre><code>from plone.portlets.utils import unregisterPortletType unregisterPortletType(site, 'portlets.Calendar') </code></pre> <p>You can also just use the GenericSetup portlets.xml file to remove the portlets during setup time, just list the portlets <code>addview</code> parameter and add a <code>remove</code> attribute to the element:</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;portlets&gt; &lt;portlet addview="portlets.Calendar" remove="true" /&gt; &lt;/portlets&gt; </code></pre> <p>Thanks to David Glick for finding that one for us.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload