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?
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.
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With