How to exclude images from Plone navigation tree by default
Asked Answered
A

3

7

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?

Ahmad answered 27/2, 2013 at 12:48 Comment(0)
P
9

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.

Palliasse answered 27/2, 2013 at 13:12 Comment(0)
B
3

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>
Bulley answered 27/2, 2013 at 17:7 Comment(0)
I
1

You have the options for Navigationin the Site Setup menu. Remove the tick on image for displayed content types and images are not longer shown on site navigation and site maps.

Inwrap answered 17/8, 2016 at 6:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.