Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to exclude images from Plone navigation tree by default

Tags:

plone

I notice that if I make a page and add and upload an image to include in it, by default it is included in the site navigation. How can I stop this from happening automatically?

like image 757
Adrian Garner Avatar asked Feb 27 '13 12:02

Adrian Garner


2 Answers

Option 1

There is a Plone setting which tells which types are included in the navigation. Go to ZMI > portal_propeties > navtree_properties > metaTypesNotToList and add Image there.

Option 2

For each image, toggle checkbox "Exclude in navigation" on Image's Settings tab.

like image 160
Mikko Ohtamaa Avatar answered Sep 20 '22 04:09

Mikko Ohtamaa


if you need to do so on a container basis, you could use the content rule included in sc.contentrules.metadata.

just add it to your buidout and configure it manually to set the ExcludeFromNav field to True.

an alternate way to do so is to include a contentrules.xml in your project profile with something like this:

<?xml version="1.0"?>
<contentrules purge="True">
 <rule name="exclude-on-add" title="Images are excluded from navigation when added"
    description="" enabled="True"
    event="zope.lifecycleevent.interfaces.IObjectAddedEvent"
    stop-after="False">
  <conditions>
   <condition type="plone.conditions.PortalType">
    <property name="check_types">
     <element>Image</element>
    </property>
   </condition>
  </conditions>
  <actions>
   <action type="sc.contentrules.actions.ExcludeFromNav">
    <property name="exclude">True</property>
   </action>
  </actions>
 </rule>
 <assignment name="exclude-on-add" bubbles="True" enabled="True" location="/your-container"/>
</contentrules>
like image 33
hvelarde Avatar answered Sep 23 '22 04:09

hvelarde